English 中文(简体)
在哪里可以读取源代码?
原标题:where can I read the source code?

I am using squeak4.1 for development, when I am looking up add method in method chain below: Kernel-Numbers -> Integer -> arithmetic -> + ,the method for adding is +, in + method I find sample code like this :

ifTrue: [^ (self digitAdd: t1) normalize].

我能知道我如何追踪到digitalAdd并在smalltalk中查看add方法的实现吗?首先谢谢!

问题回答

当消息发送到self时,您可以查询Integer类本身的定义。为此,右键单击系统浏览器中的Integer,选择“查找方法”,然后在出现的搜索窗口中输入`digitalAdd。单击“接受”按钮。这将显示消息定义。

您也可以使用Squeak中的搜索功能。(主菜单栏上的搜索框)。

Select string digitAdd: in text editor, and press Alt-m shortcut or right-click and in opened menu find implementors of it . This will open a window with all methods in all classes in system which implement given message.





相关问题
Find references to string/symbol/method

This relates to the Dolphin variant of Smalltalk. I m digging around in the image to try and figure this out but haven t find the correct method invocation yet and I m hoping someone might be able ...

How do you set the class of an object to something else?

I ve seen this recently and now I can t find it … How do you set the class of an object to something else? --Update: Well, in Pharo! Like: d:=Object new. d setClass: Dictionary. Only that it isn ...

Showing inherited methods in Squeak/Pharo Smalltalk

I m familiar with the VisualWorks and Dolphin versions of Smalltalk, but have not previously used Squeak. I m just familiarising myself with Pharo, which is a cleaned up fork of Squeak. I m used to ...

What is so special about Smalltalk? [closed]

In every technical publication, and on this site too, people are always comparing OO languages to Smalltalk. My experience is in Java: is Smalltalk so important that I should study it?

Migrating from SUnit to Phexample

I m trying out Pharo s Phexample and I like it, but it feels clumsy to have half my unit tests in SUnit and the other half in Phexample. Does Phexample have like an import feature for my existing ...

Distributed source control for VisualWorks Smalltalk

One of the annoying things about Smalltalk is that it (usually) requires its own VCS, due to the way that it manages its source code. Squeak and Gemstone (at least in its GLASS version) have a DVCS ...

热门标签