Pragma "only for place of definition", is there one?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Pragma "only for place of definition", is there one?

Herby Vojčík
Hi!

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
     <onlyForMe>
     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