On Dec 19, 2007, at 10:25 AM, Peter Suk wrote:
> Folks,
>
> I’d like to implement a pragma that causes the method wherein the
> pragma invocation is contained to overwrite all other methods of the
> same name. This is to implement a lightweight “Generalization
> Interface” feature. I’m not sure there is a clean way to do this.
> It seems that pragmas are really meant to annotate methods so that
> they can be found at a later time. So the only way I’ve found to
> execute code when you’re saving a method with a pragma is to add a
> hook into Behavior>>addSelector:withMethod:. This won’t work with
> code stored in BOSS files, but this doesn’t concern me.
>
> So, is there a better way to do this?
>
Whenever a method with a <method tag> is changed, added, or removed,
the object for which it happens is sent either classMethodsChanged or
instanceMethodsChanged.
Yes I agree, they're not "pragmas" in the conventional sense, since
that term is usually used as a "compiler directive." The only example
of this is the <primitive: #> tag. Which is why... you rarely see me
use the term. :)
--
Travis Griggs
Objologist
Time and Countertops. They both get used up way too fast.