Pragmas/Annotations for classes

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

Pragmas/Annotations for classes

Torsten Bergmann
Currently only methods support pragmas in Pharo. Therefore we already had a discussion
about "Pragmas/Annotations for classes". See

http://forum.world.st/Pragmas-Annotations-for-classes-td2282310.html

To summarize: it would be helpfull to have them (and with them also get rid of workarounds
like specific conventions, abusing class comments, etc.).

At that time it was not possible to add an iVar to Class, but this issue
was solved already:
https://pharo.fogbugz.com/f/cases/11596/Adding-an-iVar-to-class-Class-gives-error
Must admit I havent tested in latest Pharo 4 if this is still working.

After we now have slots and other nice extensions in Pharo again my basic
question: what about having "annotations" for a class in Pharo. I think we will
find enough use cases on annotating a class with someting useful. Even a category
or a comment could just be an annotation.

Is there interest to have such a change for Pharo4 or are there reasons to abandon such
an idea. I guess such a change could not be provided with a simple slice. Any thoughts/decisions?

Thanks
T.



Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Marcus Denker-4

On 15 Sep 2014, at 21:58, Torsten Bergmann <[hidden email]> wrote:

> Currently only methods support pragmas in Pharo. Therefore we already had a discussion
> about "Pragmas/Annotations for classes". See
>
> http://forum.world.st/Pragmas-Annotations-for-classes-td2282310.html
>
> To summarize: it would be helpfull to have them (and with them also get rid of workarounds
> like specific conventions, abusing class comments, etc.).
>
> At that time it was not possible to add an iVar to Class, but this issue
> was solved already:
> https://pharo.fogbugz.com/f/cases/11596/Adding-an-iVar-to-class-Class-gives-error
> Must admit I havent tested in latest Pharo 4 if this is still working.
>
> After we now have slots and other nice extensions in Pharo again my basic
> question: what about having "annotations" for a class in Pharo. I think we will
> find enough use cases on annotating a class with someting useful. Even a category
> or a comment could just be an annotation.
>
> Is there interest to have such a change for Pharo4 or are there reasons to abandon such
> an idea. I guess such a change could not be provided with a simple slice. Any thoughts/decisions?


Interest: Yes. But I personally need to finish Slots+Reflectivity before being able to even think about
this. So it would be nice if someone would do some prototypes about this…

        Marcus
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

stepharo
In reply to this post by Torsten Bergmann
What would be design of a possible solution?
With a different class creation it would be possible

Color subclass: #TranslucentColor
     instanceVariables: 'alph';
     annotation: #deprecated.

nothing prevent us to design something, this is just that we are stuck
in the past :)
Stef

On 15/9/14 21:58, Torsten Bergmann wrote:

> Currently only methods support pragmas in Pharo. Therefore we already had a discussion
> about "Pragmas/Annotations for classes". See
>
> http://forum.world.st/Pragmas-Annotations-for-classes-td2282310.html
>
> To summarize: it would be helpfull to have them (and with them also get rid of workarounds
> like specific conventions, abusing class comments, etc.).
>
> At that time it was not possible to add an iVar to Class, but this issue
> was solved already:
> https://pharo.fogbugz.com/f/cases/11596/Adding-an-iVar-to-class-Class-gives-error
> Must admit I havent tested in latest Pharo 4 if this is still working.
>
> After we now have slots and other nice extensions in Pharo again my basic
> question: what about having "annotations" for a class in Pharo. I think we will
> find enough use cases on annotating a class with someting useful. Even a category
> or a comment could just be an annotation.
>
> Is there interest to have such a change for Pharo4 or are there reasons to abandon such
> an idea. I guess such a change could not be provided with a simple slice. Any thoughts/decisions?
>
> Thanks
> T.
>
>
>
>