Pragmas/Annotations for classes

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

Pragmas/Annotations for classes

Torsten Bergmann
Hi,

while it is possible to annotate methods using Pragmas,
what about classes?

Thx
T.
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Alexandre Bergel
Maybe something can be done using the class comment.

Cheers,
Alexandre


On 8 Jul 2010, at 15:35, Torsten Bergmann wrote:

> Hi,
>
> while it is possible to annotate methods using Pragmas,
> what about classes?
>
> Thx
> T.
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Simon Denier-3
In reply to this post by Torsten Bergmann

One convention used (in Moose) is to put the pragma in a method class-side. But, it's just a convention.


On 8 juil. 2010, at 15:35, Torsten Bergmann wrote:

> Hi,
>
> while it is possible to annotate methods using Pragmas,
> what about classes?
>
> Thx
> T.
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
 Simon




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Stéphane Ducasse
In reply to this post by Torsten Bergmann
May be using a class method?
But yes this would be important.

Alex if we use comment we would have to parse them and this is not good.

Stef

On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:

> Hi,
>
> while it is possible to annotate methods using Pragmas,
> what about classes?
>
> Thx
> T.
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Lukas Renggli
Use a pragma to mark class pragmas. Or simply know which pragma
selectors need to be interpreted on the class.

Lukas

On Thursday, July 8, 2010, Stéphane Ducasse <[hidden email]> wrote:

> May be using a class method?
> But yes this would be important.
>
> Alex if we use comment we would have to parse them and this is not good.
>
> Stef
>
> On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>
>> Hi,
>>
>> while it is possible to annotate methods using Pragmas,
>> what about classes?
>>
>> Thx
>> T.
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Eliot Miranda-2


On Thu, Jul 8, 2010 at 8:19 AM, Lukas Renggli <[hidden email]> wrote:
Use a pragma to mark class pragmas. Or simply know which pragma
selectors need to be interpreted on the class.

[I know Lukas knows this but I'll say it anyway].

Do the former. The latter is weak.  It means two unrelated packages wanting to add a class pragma end up colliding.  Using a pragma to mark the class pragma allows choosing an arbitrary selector and hence makes it easy to avoid the collision.
 

Lukas

On Thursday, July 8, 2010, Stéphane Ducasse <[hidden email]> wrote:
> May be using a class method?
> But yes this would be important.
>
> Alex if we use comment we would have to parse them and this is not good.
>
> Stef
>
> On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>
>> Hi,
>>
>> while it is possible to annotate methods using Pragmas,
>> what about classes?
>>
>> Thx
>> T.
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>

--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Alexandre Bergel
In reply to this post by Stéphane Ducasse
> May be using a class method?
> But yes this would be important.

The initialize method of the metaclass maybe.

Alexandre

>
> On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>
>> Hi,
>>
>> while it is possible to annotate methods using Pragmas,
>> what about classes?
>>
>> Thx
>> T.
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Guillermo Polito
Why not add an extension to the #subclass: method family like

Object subclass: #AppRegistry
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    pragmas: '<pragma1> <pragma2>'
    category: 'System-Applications'

?

On Thu, Jul 8, 2010 at 12:54 PM, Alexandre Bergel <[hidden email]> wrote:
> May be using a class method?
> But yes this would be important.

The initialize method of the metaclass maybe.

Alexandre

>
> On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>
>> Hi,
>>
>> while it is possible to annotate methods using Pragmas,
>> what about classes?
>>
>> Thx
>> T.
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Stéphane Ducasse
In reply to this post by Lukas Renggli
> Use a pragma to mark class pragmas. Or simply know which pragma
> selectors need to be interpreted on the class.

what do you mean I'm confused.
Can you show an example?

Stef


> Lukas
>
> On Thursday, July 8, 2010, Stéphane Ducasse <[hidden email]> wrote:
>> May be using a class method?
>> But yes this would be important.
>>
>> Alex if we use comment we would have to parse them and this is not good.
>>
>> Stef
>>
>> On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>>
>>> Hi,
>>>
>>> while it is possible to annotate methods using Pragmas,
>>> what about classes?
>>>
>>> Thx
>>> T.
>>> --
>>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Lukas Renggli
On 8 July 2010 19:58, Stéphane Ducasse <[hidden email]> wrote:
>> Use a pragma to mark class pragmas.

For example:

   foo
      <classAnnotation>
      <foo: 1 bar: 2>

>> Or simply know which pragma
>> selectors need to be interpreted on the class.

You you make up the convention in your code that all #foo:bar: pragmas
are interpreted in the context of the class. It is anyway up to you
how you interpret your pragmas.

Lukas

--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Mariano Martinez Peck
In reply to this post by Alexandre Bergel


On Thu, Jul 8, 2010 at 3:39 PM, Alexandre Bergel <[hidden email]> wrote:
Maybe something can be done using the class comment.


No, please don't. This kind of things are like the Monticello hack to use the category (when using *APackage) as package extensions.
 
Cheers,
Alexandre


On 8 Jul 2010, at 15:35, Torsten Bergmann wrote:

> Hi,
>
> while it is possible to annotate methods using Pragmas,
> what about classes?
>
> Thx
> T.
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Mariano Martinez Peck
In reply to this post by Guillermo Polito


2010/7/8 Guillermo Polito <[hidden email]>
Why not add an extension to the #subclass: method family like

Object subclass: #AppRegistry
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    pragmas: '<pragma1> <pragma2>'
    category: 'System-Applications'


good idea. But then, you need to have a collection of Pragmas in Behavior, ClassDescription or similar.  Did I understand well?



 
?


On Thu, Jul 8, 2010 at 12:54 PM, Alexandre Bergel <[hidden email]> wrote:
> May be using a class method?
> But yes this would be important.

The initialize method of the metaclass maybe.

Alexandre

>
> On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>
>> Hi,
>>
>> while it is possible to annotate methods using Pragmas,
>> what about classes?
>>
>> Thx
>> T.
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Nicolas Cellier


2010/7/8 Mariano Martinez Peck <[hidden email]>


2010/7/8 Guillermo Polito <[hidden email]>
Why not add an extension to the #subclass: method family like

Object subclass: #AppRegistry
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    pragmas: '<pragma1> <pragma2>'
    category: 'System-Applications'


good idea. But then, you need to have a collection of Pragmas in Behavior, ClassDescription or similar.  Did I understand well?


Would it be easily extensible ? I mean extending the class of another package...

Nicolas



 
?


On Thu, Jul 8, 2010 at 12:54 PM, Alexandre Bergel <[hidden email]> wrote:
> May be using a class method?
> But yes this would be important.

The initialize method of the metaclass maybe.

Alexandre

>
> On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>
>> Hi,
>>
>> while it is possible to annotate methods using Pragmas,
>> what about classes?
>>
>> Thx
>> T.
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Igor Stasenko
Guys, i really wonder, how it differs from using a usual smalltalk syntax for
class declaration?

pragmas: '<pragma1> <pragma2>'

can be written as:

pragmas: 'pragma1 pragma2'

without any loss of extensibility/flexibility/whatever.

Of course, we can put any sequence of characters into the string
literal and parse
them in any way we want to, to extract some extra information. But is
it worth it?
But i wonder, why we should invent so over-complicated ways to do simple things?

In any way, if we need that class should carry additional information,
which needs to be formally represented in
declaration, then i why not just keep using ordinary syntax, by adding
either additional keywords, or even statements.
Just look at ProtoObject declaration:

ProtoObject subclass: #ProtoObject
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Kernel-Objects'.
ProtoObject superclass: nil

if we want to extend this, it is logically to follow the same pattern
and add any other statements, like:

MyClass foo: bar.

Just my 2c.

2010/7/9 Nicolas Cellier <[hidden email]>:

>
>
> 2010/7/8 Mariano Martinez Peck <[hidden email]>
>>
>>
>> 2010/7/8 Guillermo Polito <[hidden email]>
>>>
>>> Why not add an extension to the #subclass: method family like
>>>
>>> Object subclass: #AppRegistry
>>>     instanceVariableNames: ''
>>>     classVariableNames: ''
>>>     poolDictionaries: ''
>>>     pragmas: '<pragma1> <pragma2>'
>>>     category: 'System-Applications'
>>>
>>
>> good idea. But then, you need to have a collection of Pragmas in Behavior,
>> ClassDescription or similar.  Did I understand well?
>>
>
> Would it be easily extensible ? I mean extending the class of another
> package...
>
> Nicolas
>
>>
>>
>>
>>>
>>> ?
>>>
>>> On Thu, Jul 8, 2010 at 12:54 PM, Alexandre Bergel <[hidden email]>
>>> wrote:
>>>>
>>>> > May be using a class method?
>>>> > But yes this would be important.
>>>>
>>>> The initialize method of the metaclass maybe.
>>>>
>>>> Alexandre
>>>>
>>>> >
>>>> > On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>>>> >
>>>> >> Hi,
>>>> >>
>>>> >> while it is possible to annotate methods using Pragmas,
>>>> >> what about classes?
>>>> >>
>>>> >> Thx
>>>> >> T.
>>>> >> --
>>>> >> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>>>> >> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>>> >>
>>>> >> _______________________________________________
>>>> >> Pharo-project mailing list
>>>> >> [hidden email]
>>>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > Pharo-project mailing list
>>>> > [hidden email]
>>>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> Alexandre Bergel  http://www.bergel.eu
>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Guillermo Polito
In reply to this post by Mariano Martinez Peck


2010/7/8 Mariano Martinez Peck <[hidden email]>


2010/7/8 Guillermo Polito <[hidden email]>

Why not add an extension to the #subclass: method family like

Object subclass: #AppRegistry
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    pragmas: '<pragma1> <pragma2>'
    category: 'System-Applications'


good idea. But then, you need to have a collection of Pragmas in Behavior, ClassDescription or similar.  Did I understand well?

 
Here are two mixed up concerns.  Where should the class pragmas stored, and where should them be defined.  I think it is practical to define them in the class definition...  Then they can be stored as:

- a collection of pragmas in each class, which make us have a collection per class.
- a pragmas string definition in each class, which make us "compile" or "parse" (I don't know how is this working now) the class pragmas when them to a class.
- a global dictionary? Puaj.

Where would you like to store a class pragma instead? 
I thought the class or the behaviour was the place to store it...

Anyway, where are the method pragmas stored today?  In the CompiledMethod?




 
?


On Thu, Jul 8, 2010 at 12:54 PM, Alexandre Bergel <[hidden email]> wrote:
> May be using a class method?
> But yes this would be important.

The initialize method of the metaclass maybe.

Alexandre

>
> On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>
>> Hi,
>>
>> while it is possible to annotate methods using Pragmas,
>> what about classes?
>>
>> Thx
>> T.
>> --
>> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Guillermo Polito
In reply to this post by Igor Stasenko


On Thu, Jul 8, 2010 at 8:55 PM, Igor Stasenko <[hidden email]> wrote:
Guys, i really wonder, how it differs from using a usual smalltalk syntax for
class declaration?

pragmas: '<pragma1> <pragma2>'

can be written as:

pragmas: 'pragma1 pragma2' 

without any loss of extensibility/flexibility/whatever.

Agree, I just put it as an example.  Indeed I like more your simpler version :).
 

Of course, we can put any sequence of characters into the string
literal and parse
them in any way we want to, to extract some extra information. But is
it worth it?
But i wonder, why we should invent so over-complicated ways to do simple things?

In any way, if we need that class should carry additional information,
which needs to be formally represented in
declaration, then i why not just keep using ordinary syntax, by adding
either additional keywords, or even statements.
Just look at ProtoObject declaration:

ProtoObject subclass: #ProtoObject
       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'Kernel-Objects'.
ProtoObject superclass: nil

if we want to extend this, it is logically to follow the same pattern
and add any other statements, like:

MyClass foo: bar.

Do you mean something like...

ProtoObject subclass: #ProtoObject
       instanceVariableNames: ''
       classVariableNames: ''
       poolDictionaries: ''
       category: 'Kernel-Objects'.
ProtoObject superclass: nil
ProtoObject pragmas: 'pragma1 pragma2 pragma3'

?
That would be nice :D. We decouple the pragmas from the declaration and we avoid making the combinatory :P.

 

Just my 2c.

2010/7/9 Nicolas Cellier <[hidden email]>:
>
>
> 2010/7/8 Mariano Martinez Peck <[hidden email]>
>>
>>
>> 2010/7/8 Guillermo Polito <[hidden email]>
>>>
>>> Why not add an extension to the #subclass: method family like
>>>
>>> Object subclass: #AppRegistry
>>>     instanceVariableNames: ''
>>>     classVariableNames: ''
>>>     poolDictionaries: ''
>>>     pragmas: '<pragma1> <pragma2>'
>>>     category: 'System-Applications'
>>>
>>
>> good idea. But then, you need to have a collection of Pragmas in Behavior,
>> ClassDescription or similar.  Did I understand well?
>>
>
> Would it be easily extensible ? I mean extending the class of another
> package...
>
> Nicolas
>
>>
>>
>>
>>>
>>> ?
>>>
>>> On Thu, Jul 8, 2010 at 12:54 PM, Alexandre Bergel <[hidden email]>
>>> wrote:
>>>>
>>>> > May be using a class method?
>>>> > But yes this would be important.
>>>>
>>>> The initialize method of the metaclass maybe.
>>>>
>>>> Alexandre
>>>>
>>>> >
>>>> > On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>>>> >
>>>> >> Hi,
>>>> >>
>>>> >> while it is possible to annotate methods using Pragmas,
>>>> >> what about classes?
>>>> >>
>>>> >> Thx
>>>> >> T.
>>>> >> --
>>>> >> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>>>> >> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>>>> >>
>>>> >> _______________________________________________
>>>> >> Pharo-project mailing list
>>>> >> [hidden email]
>>>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > Pharo-project mailing list
>>>> > [hidden email]
>>>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>>
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> Alexandre Bergel  http://www.bergel.eu
>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Pharo-project mailing list
>>>> [hidden email]
>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>>
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Igor Stasenko
2010/7/9 Guillermo Polito <[hidden email]>:

>
>
> On Thu, Jul 8, 2010 at 8:55 PM, Igor Stasenko <[hidden email]> wrote:
>>
>> Guys, i really wonder, how it differs from using a usual smalltalk syntax
>> for
>> class declaration?
>>
>> pragmas: '<pragma1> <pragma2>'
>>
>> can be written as:
>>
>> pragmas: 'pragma1 pragma2'
>>
>> without any loss of extensibility/flexibility/whatever.
>
> Agree, I just put it as an example.  Indeed I like more your simpler version
> :).
>
>>
>> Of course, we can put any sequence of characters into the string
>> literal and parse
>> them in any way we want to, to extract some extra information. But is
>> it worth it?
>> But i wonder, why we should invent so over-complicated ways to do simple
>> things?
>>
>> In any way, if we need that class should carry additional information,
>> which needs to be formally represented in
>> declaration, then i why not just keep using ordinary syntax, by adding
>> either additional keywords, or even statements.
>> Just look at ProtoObject declaration:
>>
>> ProtoObject subclass: #ProtoObject
>>        instanceVariableNames: ''
>>        classVariableNames: ''
>>        poolDictionaries: ''
>>        category: 'Kernel-Objects'.
>> ProtoObject superclass: nil
>>
>> if we want to extend this, it is logically to follow the same pattern
>> and add any other statements, like:
>>
>> MyClass foo: bar.
>
> Do you mean something like...
>
> ProtoObject subclass: #ProtoObject
>        instanceVariableNames: ''
>        classVariableNames: ''
>        poolDictionaries: ''
>        category: 'Kernel-Objects'.
> ProtoObject superclass: nil
> ProtoObject pragmas: 'pragma1 pragma2 pragma3'
>
> ?
> That would be nice :D. We decouple the pragmas from the declaration and we
> avoid making the combinatory :P.
>
yes.
But i don't understand why i would want to do this?
Let us put it straight and look into roots:
- you want to attach an arbitrary data to a class.
It could be used for anything, like comment, author, stamp, icon etc etc.
Adding just pragmas, for me, looks like too narrow and short-sighted
extension, which not really
helpful nor future-proof.
I'd rather look for something , which would allow me to attach any
meta-data to class,
and corresponding mechanisms to replicate it from/to source code or
binary format(s).
As well, as improve tools support for easy
navigating/inspecting/searching this data.

>
>>
>> Just my 2c.
>>
>> 2010/7/9 Nicolas Cellier <[hidden email]>:
>> >
>> >
>> > 2010/7/8 Mariano Martinez Peck <[hidden email]>
>> >>
>> >>
>> >> 2010/7/8 Guillermo Polito <[hidden email]>
>> >>>
>> >>> Why not add an extension to the #subclass: method family like
>> >>>
>> >>> Object subclass: #AppRegistry
>> >>>     instanceVariableNames: ''
>> >>>     classVariableNames: ''
>> >>>     poolDictionaries: ''
>> >>>     pragmas: '<pragma1> <pragma2>'
>> >>>     category: 'System-Applications'
>> >>>
>> >>
>> >> good idea. But then, you need to have a collection of Pragmas in
>> >> Behavior,
>> >> ClassDescription or similar.  Did I understand well?
>> >>
>> >
>> > Would it be easily extensible ? I mean extending the class of another
>> > package...
>> >
>> > Nicolas
>> >
>> >>
>> >>
>> >>
>> >>>
>> >>> ?
>> >>>
>> >>> On Thu, Jul 8, 2010 at 12:54 PM, Alexandre Bergel
>> >>> <[hidden email]>
>> >>> wrote:
>> >>>>
>> >>>> > May be using a class method?
>> >>>> > But yes this would be important.
>> >>>>
>> >>>> The initialize method of the metaclass maybe.
>> >>>>
>> >>>> Alexandre
>> >>>>
>> >>>> >
>> >>>> > On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:
>> >>>> >
>> >>>> >> Hi,
>> >>>> >>
>> >>>> >> while it is possible to annotate methods using Pragmas,
>> >>>> >> what about classes?
>> >>>> >>
>> >>>> >> Thx
>> >>>> >> T.
>> >>>> >> --
>> >>>> >> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>> >>>> >> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>> >>>> >>
>> >>>> >> _______________________________________________
>> >>>> >> Pharo-project mailing list
>> >>>> >> [hidden email]
>> >>>> >>
>> >>>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >>>> >
>> >>>> >
>> >>>> > _______________________________________________
>> >>>> > Pharo-project mailing list
>> >>>> > [hidden email]
>> >>>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >>>>
>> >>>> --
>> >>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> >>>> Alexandre Bergel  http://www.bergel.eu
>> >>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> _______________________________________________
>> >>>> Pharo-project mailing list
>> >>>> [hidden email]
>> >>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >>>
>> >>>
>> >>> _______________________________________________
>> >>> Pharo-project mailing list
>> >>> [hidden email]
>> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >>
>> >>
>> >> _______________________________________________
>> >> Pharo-project mailing list
>> >> [hidden email]
>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>> >
>> > _______________________________________________
>> > Pharo-project mailing list
>> > [hidden email]
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>>
>>
>>
>> --
>> Best regards,
>> Igor Stasenko AKA sig.
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Stéphane Ducasse

> But i don't understand why i would want to do this?
> Let us put it straight and look into roots:
> - you want to attach an arbitrary data to a class.
> It could be used for anything, like comment, author, stamp, icon etc etc.
> Adding just pragmas, for me, looks like too narrow and short-sighted
> extension, which not really
> helpful nor future-proof.
> I'd rather look for something , which would allow me to attach any
> meta-data to class,
> and corresponding mechanisms to replicate it from/to source code or
> binary format(s).
> As well, as improve tools support for easy
> navigating/inspecting/searching this data.

class methods?
cheap?


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

Igor Stasenko
On 9 July 2010 08:36, Stéphane Ducasse <[hidden email]> wrote:

>
>> But i don't understand why i would want to do this?
>> Let us put it straight and look into roots:
>> - you want to attach an arbitrary data to a class.
>> It could be used for anything, like comment, author, stamp, icon etc etc.
>> Adding just pragmas, for me, looks like too narrow and short-sighted
>> extension, which not really
>> helpful nor future-proof.
>> I'd rather look for something , which would allow me to attach any
>> meta-data to class,
>> and corresponding mechanisms to replicate it from/to source code or
>> binary format(s).
>> As well, as improve tools support for easy
>> navigating/inspecting/searching this data.
>
> class methods?
> cheap?
>
right. why inventing a wheel, when by simply adding a class methods,
you can encode anything there.

>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Pragmas/Annotations for classes

csrabak
In reply to this post by Stéphane Ducasse
Stef,


Just to have a better grasp of your reasoning: Are you suggesting we put annotations in a method and just have it/them lumped in an 'Annotations' protocol or are you suggesting a more radical change which will require the toolset to have changes in sync to them?
 



Em 08/07/2010 11:48, Stéphane Ducasse < [hidden email] > escreveu:
May be using a class method?
But yes this would be important.

Alex if we use comment we would have to parse them and this is not good.

Stef

On Jul 8, 2010, at 3:35 PM, Torsten Bergmann wrote:

> Hi,
>
> while it is possible to annotate methods using Pragmas,
> what about classes?
>
> Thx
> T.
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
12