0

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].

Can I know how I can trace into digitAdd and look the implementation of add method in smalltalk? thanks first!

parsifal
  • 879
  • 4
  • 12
  • 21

2 Answers2

1

As the message is send to self, you can query the Integer class itself for its definition. For this, right click Integer in the System Browser, select "find method" and enter `digitAdd' in the search window that appears. Click the "Accept" button. This will show you the message definition.

You can also use the search facility in Squeak. (the search box on the main menu bar).

Vijay Mathew
  • 26,737
  • 4
  • 62
  • 93
1

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.

Igor Stasenko
  • 1,037
  • 5
  • 8