Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find which messages an object understands?

In Pharo, I know that integers understand the message to:. The workspace offers suggestions:

workspace suggestions

But if I inspect an integer from the workspace, it doesn't mention to::

inspecting integer

Searching for SmallInteger doesn't show anything in the system browser either:

system browser

How do I discover which messages I can send to objects? Ideally I'd like to see their source code too.

like image 443
Wilfred Hughes Avatar asked Jun 05 '14 21:06

Wilfred Hughes


1 Answers

Revisiting your question I noticed that, in your last screenshot, you did not search for the class SmallInteger but for a package named SmallInteger. This Package does not exist.

But you probably wanted to search for the class SmallInteger. This is done by the keyboard shortcut Cmd-F Cmd-C (Alt-F Alt-C on Linux) or by selecting Find Class… in the context menu of the class panel of the Nautilus system browser. This lets you browse the methods implemented in SmallInteger. If you work up your way through the superclasses you can have a look at all messages understood by an instance of SmallInteger.

enter image description here

like image 52
MartinW Avatar answered Sep 30 '22 01:09

MartinW