Thanks
On Thu, Sep 28, 2017 at 6:36 PM, Denis Kudriashov <dionisi...@gmail.com> wrote: > 2017-09-28 18:17 GMT+02:00 Denis Kudriashov <dionisi...@gmail.com>: > >> 2017-09-25 17:57 GMT+02:00 Denis Kudriashov <dionisi...@gmail.com>: >> >>> 2017-09-25 17:38 GMT+02:00 Stephane Ducasse <stepharo.s...@gmail.com>: >>> >>>> I agree with guille. We should just called them class annotations. >>>> >>>> Denis what is a declared instance (is it an object returned by the >>>> method having the annotation) >>>> but can we find a better name. >>>> >>> >>> My idea that the method with pragma #classMetaAnnotation is the >>> declaration of annotation. Internally this declaration creates instance of >>> specified annotation which cached by system. And users access all these >>> declared instances for reflection purposes. >>> >>> >> Maybe #registeredInstances would be better? >> > > So I rename these messages too. I think it's better. > > >> >>> Also annotation has inst var declarationSelector. >>> >> >>> >>>> may be effectiveInstances? >>>> >>> >>> I don't like this name. I not understand "effective" in that context. >>> >>> >>>> >>>> >>>> On Mon, Sep 25, 2017 at 5:09 PM, Guillermo Polito < >>>> guillermopol...@gmail.com> wrote: >>>> >>>>> Why calling them meta-annotation and not just annotation? Annotations >>>>> are in general already meta :) >>>>> >>>>> On Mon, Sep 25, 2017 at 5:01 PM, Denis Kudriashov < >>>>> dionisi...@gmail.com> wrote: >>>>> >>>>>> Hi. >>>>>> >>>>>> I glad to present one class package which introduces reusable >>>>>> mechanism for first class annotations. >>>>>> >>>>>> The project can be found on github https://github.com/dion >>>>>> isiydk/ClassMetaAnnotation. >>>>>> And I tried to describe why it is needed in my blog >>>>>> http://dionisiydk.blogspot.fr/2017/09/class-meta-annotations.html. >>>>>> >>>>>> And here is overview: >>>>>> >>>>>> Every annotation should be subclass of ClassMetaAnnotation. To attach >>>>>> it to class you create new class side method which will return an >>>>>> instance >>>>>> of the annotation. Method should be marked with pragma >>>>>> #classMetaAnnotation: >>>>>> >>>>>> >>>>>> MyClass class>>specialAnnotation >>>>>> >>>>>> <classMetaAnnotation> >>>>>> >>>>>> ^MySpecialAnnotation new >>>>>> >>>>>> >>>>>> To query annotations from system there are two methods: >>>>>> >>>>>> 1) You can ask concrete annotation class for all declared instances: >>>>>> >>>>>> MySpecialAnnotation declaredInstances >>>>>> >>>>>> 2) You can ask given class for all attached annotations: >>>>>> >>>>>> MyClass metaAnnotations >>>>>> >>>>>> Every annotation includes information about annotated class and the >>>>>> selector of declaring method. >>>>>> All annotations are cached. So it is cheap to query them. There are >>>>>> extra messages to enumerate annotations using block. >>>>>> >>>>>> Now let's discuss it. I think it can be good addition for the Pharo >>>>>> 7. Especially that it is very small code. >>>>>> >>>>>> Also I would like to thank Marcus who helps me realize this concept >>>>>> in Commander and Calypso which I start simplify with this library. >>>>>> >>>>>> Best regards, >>>>>> Denis >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> >>>>> >>>>> Guille Polito >>>>> >>>>> Research Engineer >>>>> >>>>> Centre de Recherche en Informatique, Signal et Automatique de Lille >>>>> >>>>> CRIStAL - UMR 9189 >>>>> >>>>> French National Center for Scientific Research - *http://www.cnrs.fr >>>>> <http://www.cnrs.fr>* >>>>> >>>>> >>>>> *Web:* *http://guillep.github.io* <http://guillep.github.io> >>>>> >>>>> *Phone: *+33 06 52 70 66 13 <+33%206%2052%2070%2066%2013> >>>>> >>>> >>>> >>> >> >