[Pharo-project] [squeak-dev] Re: Menu Registries

Hannes Hirzel hannes.hirzel at gmail.com
Wed Apr 28 19:57:06 UTC 2010

On 4/28/10, Henrik Sperre Johansen <henrik.s.johansen at veloxit.no> wrote:
>   On 28.04.2010 17:47, Brent Pinkney wrote:
>> Hi all,+
>> Could those in the know comment on how this<...>  proposal is (or is not)
>> consistent with the fundamental Smalltalk principles
>> that:
>> 1. "an object is send a message and responds with an object"
>> 2. there is no other "magic" in the system.

> Take 15 mins to read the code dealing with Pragma preferences, and you'd
> have your answer.
> The short answer is no, they just provide a different way of dynamically
> deciding what message you want to send.
> The closest equivalent would be the logic used to decide which
> ImageReadWriter subclass to actually use.
> Cheers,
> Henry
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


I took your piece of advice of using 15 minutes to check out what
Pharo pragma/method annotation wise and below is what I discovered.
You might want directly to jump to the end for 3 questions


OK, 15 minutes

1. I open the Pharo 1.0 One-click image and type 'Pragma' in the search browser.
(Note: it is not pristine, I have loaded Pier2 into it)

2 .There are five classes which contain 'Pragma'.
Only Pragma has a class comment. It is very similar to the one in Squeak 4.1.

3. In this comment I am offered to evaluate

	SystemNavigation default browseAllSelect: [:m| m pragmas notEmpty]

	and to browse all nonprimitive methods with pragmas evaluate
	SystemNavigation default browseAllSelect: [:m| m primitive isZero
and: [m pragmas notEmpty]]

   a) gives me 971 methods with pragmas in it, b) 219 - these are the
ones of interest - the non primitive ones

4) Looking at the 219 pragmas reveals the following examples

a) Very frequent ones - they deal with configuration managment
<version: '1.0-baseline'>
<version: '2.0' imports: #('2.0-baseline')>

b) The ones of interest for the current discussion
  <value: 'children' comment: 'Display immediate children of the
current structure.'>
  <lint: 'Unnecessary "= true"' rationale: 'Property can be nil I
imagine' author: 'stephane.ducasse'>

5) I realize that the ones in group 4b) are very few. I have not found
any pragma yet related to the menu definition.

6) I decide to go search for 'World'

I find the classes TheWorldMenu,
TheWorldMenuProvider,TheWorldMenuMainDockingbar which are of interest.

They all have class comments which is fine. In addition I find
    TheWorldMainDockingBar instance openDockingBar
which I execute and to my suprise I realize that Pharo has as well a
regular menu though with funny cartoon icons.
The entries are however not worked out yet and this is probably the
reason why it is not activated by default.

7) Looking at the menu construction code of TheWorldMenu and
TheWorldMenuMainDockingbar I do not find anything interesting
regarding pragmas. All is hard wired.

8) You wrote that you had the pragma discussion one year ago, so I was
expecting something more to be in 1.0. Maybe I should have checked out
1.1 alpha?

9) As the 15 minutes are nearly over I start to use the time for some
final questions.

A. The fact that you refer me to Google and the Nabble list to find
out the result of your pragma discussion has to be read as - there is
no such document yet. Is this correct?

B. Is there a list of pragmas and how they are supposed to be used?

C. How do you want to handle the menus with pragmas? (It seems that
Pharo is not much further advanced in this area).

More information about the Squeak-dev mailing list