Dolphin Smalltalk - 添加方法
我正在尝试在 Dolphin Smalltalk 中创建一个自定义类。当我打开工作区时,输入并评估代码:
Object subclass: #Sudoku
instanceVariableNames: 'board'
classVariableNames: ''
poolDictionaries: ''
category: 'JiPP SudokuSolver'.
一切正常,类已创建并可从类浏览器中看到。
问题是,我想向此类添加自定义成员方法,但不使用类浏览器。可以从工作区吗?我想要一个包含所有源代码的文件,这样我就不必担心保存整个图像。
I am trying to create a custom class in Dolphin Smalltalk. When I open the Workspace, type in and evaluate the code:
Object subclass: #Sudoku
instanceVariableNames: 'board'
classVariableNames: ''
poolDictionaries: ''
category: 'JiPP SudokuSolver'.
everything works fine and the class is created and visible from Class Browser.
The problem is, I want to add custom member method to this class, but without using Class Browser. Is it possible from the Workspace? I want to have one file with all the source code, so I don't have to worry about saving entire image.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用以下方法向类添加类方法:
实例方法:
话虽这么说,为什么不使用 STS 或 FileOut 来代替您的更改呢?
You can add a class method to a class using:
Instance method:
The being said, why not you STS or FileOut your changes instead?
保存一个文件比保存图像更容易吗?
与图像相同的目录中是否有change.log 文件?用文本编辑器打开它,看看里面有什么。
了解如何使用 ClassBrowser 菜单归档类和方法,然后查看这些文本文件中的内容。
(您是否添加了来源跟踪系统?)
What will be any easier about saving that one file than saving the image?
Is there a change.log file in the same directory as the image? Open it with a text editor and see what's in it.
Find out how to fileOut classes and methods using the ClassBrowser menus and then see what's in those text files.
(Do you have the Source Tracking System add on?)