如何转储 Squeak Smalltalk 映像中的所有源代码?
我已经下载了Scratch的源代码,它是用Squeak Smalltalk。我可以在 Squeak 中浏览源代码,但我真正想要的是一个大的文本文件。该图像基于 Squeak 2.8。
我是吱吱声的新手。到目前为止,我很喜欢它,而且我对这种语言和环境的印象是,如果我能更好地了解自己的方法,那么将这个映像中的所有源代码转储到一个文件中可能可以用大约 3 行代码完成。你能提供这3行代码吗?
如果它最终变成 4 行(或更可能是 1 行),我不会抱怨。
I’ve downloaded the source code of Scratch, which is written in Squeak Smalltalk. I can browse the source in Squeak, but what I really want is a big text file. The image is based on Squeak 2.8.
I’m a total Squeak newbie. So far, I’m loving it, and my impression of the language and environment is that dumping all the source code in this image to a file can probably be done in about 3 lines of code, if only I knew my way around better. Can you supply the 3 lines of code?
I won’t complain if it ends up being 4 lines (or more likely, 1 line).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
未经测试,但是:
这应该转储三百万个 .st 文件,以系统中的每个类命名。
欢迎并愉快地闲聊!
编辑:
看起来,这在早期的吱吱声中不起作用,我一直在测试,看起来以下应该在 Scratch 源代码图像中工作:
Untested, but:
This should dump three million .st files, named after each class in the system.
Welcome and happy smalltalking!
EDIT:
As it seems, this wouldn't work in early squeaks, I've been testing around and it looks the following should work in a Scratch source code image: