[Pharo-users] Pragma "only for place of definition", is there one?

Herby Vojčík herby at mailbox.sk
Sat Feb 16 18:01:17 EST 2019


I'd just like to know if there is some pragma (eg. <onlyForMe>) which 
would say to a (class-level) method only to use the code in the case 
self is method definition class, otherwise just delegate to super.

I only see it useful in class-side `initialize` method, as in:

   Foo class >> initialize
     self == Foo ifTrue: [ registry := Dictionary new ].
     ^ super initialize

would be

   Foo class >> initialize
     registry := Dictionary new

Asking because I look for a way to easily subclass JS classes in Amber 
and such pragma would be useful in such cases, and since Amber treats 
Pharo as a reference, asking for the name of the pragma if there is one.

Thanks, Herby

More information about the Pharo-users mailing list