[squeak-dev] Re: Pragma support in Squeak/Pharo/Cuis

Eliot Miranda eliot.miranda at gmail.com
Fri Jan 28 19:44:56 UTC 2011


On Fri, Jan 28, 2011 at 10:38 AM, Casey Ransberger <casey.obrien.r at gmail.com
> wrote:

> +1
>
> It looks like an XML tag. This language is most intuitive to me FWIW.
>

But it isn't.  It is a message pattern with literal arguments (a message
with literal arguments and no receiver).  It has nothing to do with XML.
 Having it as a message pattern means:
- one can search for references to the method tag by searching for senders
of the message tag's selector
- one can provide implementation(s) of the selector and hence execute the
method tag using perform

Hence method tags are better integrated in Smalltalk than in other
languages; one can do meta-programming with them.  They're not merely
annotations, they're executable annotations.  IMO the coolest uses of method
tags are those that trigger some evaluation of the method tags by some
method tag processor when methods containing method tags are either added or
removed (compiled/deleted) from the system such as automatically adding an
entry to a system menu when a method defining an action to be dispatched
from the menu is added with a method tag that references the menu.  Using
this approach one has to perform one action (compiling a method) not two
(compiling the action method and modifying/compiling the menu definition
method).

best
Eliot


> On Jan 28, 2011, at 7:00 AM, Andreas Raab <andreas.raab at gmx.de> wrote:
>
> > On 1/28/2011 3:40 PM, Chris Cunnington wrote:
> >> >Method annotations are not pragmas.
> >>
> >> It might be easier to say that method annotations never had a class to
> >> identify them with before Lukas created class
> >> Pragma in 2006.
> >
> > Unfortunately, that neither changes the statement nor does it make the
> name any better :) (and fwiw, I am in favor of Travis' "method tag"
> terminology)
> >
> > Cheers,
> >  - Andreas
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20110128/bd9a4bc6/attachment.htm


More information about the Squeak-dev mailing list