English 中文(简体)
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 having the facility in the Class Browser to show either only the methods implemented by a class or both the methods inherited and the methods implemented.

Is this useful facility missing in Squeak, or have I just been unable to find it?

最佳回答

You can double-click on any class to open a Hierarchy Browser on that particular class. The hierarchy button in the toolbar and the menu entry browse hierarchy (Ctrl+H) open the same view.

There is the Inheritance Browser that shows you the hierarchal implementations of the currently selected method. Click on the inheritance button in the toolbar.

Furthermore there is the Protocol Browser that displays all methods and super methods of a class together. To open this browser select browse protocol (Ctrl+Shift+P) in the context menu of the class.

问题回答

If you want to build a browser with that behaviour, you should take a look at the Glamour browser construction DSL.

I personally do not feel the need to see all 34 pages of method names defined in ProtoObject and Object, or the 5 pages of method categories. Object methods size prints 421.

AFAIK in the GemStoneTool there is such a thing, thre is a 1 or so and a # which seems to change the view to see all the methods available in a class (be it inherited or in the class itself) I m as amazed as you that nothing like that exists in "standard images". Maybe the users know the libraries for ages, and maybe they remember enough to not bother. ....





相关问题
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 ...

热门标签