On Nov 12, 2013, at 4:22 AM, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote:

It is not necessary better, but it saves you from having hundreds of temp vars :)

Ben

On 12 Nov 2013, at 01:49, St�phane Ducasse <stephane.ducasse@inria.fr> wrote:


Example:
aMenu addGroup: [ :aGroup |
aGroup addItem: [ :anItem |
anItem name: 'Browse Full';
action: [ self browseSelectedObject ];
shortcut: $b command mac | $b alt win | $b alt unix  ].
aGroup addItem: [ :anItem |
anItem name: 'Browse Class';
action: [ self browseSelectedObjectClass ] ] ].


I do not see the value of passing block to add element to groups
why not the normal way i.e. passing an object. I do not get why executing
a block with an object is better?

he, I thought the same :)


Stef