[Pharo-project] Pragmas/Annotations for classes
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
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
On Thu, Jul 8, 2010 at 3:39 PM, Alexandre Bergel <alexandre@bergel.eu>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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Simon
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
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 <stephane.ducasse@inria.fr> 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Lukas Renggli www.lukas-renggli.ch
On Thu, Jul 8, 2010 at 8:19 AM, Lukas Renggli <renggli@gmail.com> 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 <stephane.ducasse@inria.fr> 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Lukas Renggli www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
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 <stephane.ducasse@inria.fr> 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Lukas Renggli www.lukas-renggli.ch
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On 8 July 2010 19:58, Stéphane Ducasse <stephane.ducasse@inria.fr> 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
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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
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 <alexandre@bergel.eu>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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
2010/7/8 Guillermo Polito <guillermopolito@gmail.com>
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 <alexandre@bergel.eu>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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
2010/7/8 Mariano Martinez Peck <marianopeck@gmail.com>
2010/7/8 Guillermo Polito <guillermopolito@gmail.com>
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 <alexandre@bergel.eu>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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
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 <nicolas.cellier.aka.nice@gmail.com>:
2010/7/8 Mariano Martinez Peck <marianopeck@gmail.com>
2010/7/8 Guillermo Polito <guillermopolito@gmail.com>
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 <alexandre@bergel.eu> 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel  http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
On Thu, Jul 8, 2010 at 8:55 PM, Igor Stasenko <siguctua@gmail.com> 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 <nicolas.cellier.aka.nice@gmail.com>:
2010/7/8 Mariano Martinez Peck <marianopeck@gmail.com>
2010/7/8 Guillermo Polito <guillermopolito@gmail.com>
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 <alexandre@bergel.eu
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 Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
2010/7/9 Guillermo Polito <guillermopolito@gmail.com>:
On Thu, Jul 8, 2010 at 8:55 PM, Igor Stasenko <siguctua@gmail.com> 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 <nicolas.cellier.aka.nice@gmail.com>:
2010/7/8 Mariano Martinez Peck <marianopeck@gmail.com>
2010/7/8 Guillermo Polito <guillermopolito@gmail.com>
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 <alexandre@bergel.eu> 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 Pharo-project@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel  http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
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?
On 9 July 2010 08:36, Stéphane Ducasse <stephane.ducasse@inria.fr> 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.
2010/7/8 Mariano Martinez Peck <marianopeck@gmail.com>
2010/7/8 Guillermo Polito <guillermopolito@gmail.com>
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 <alexandre@bergel.eu>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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
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 < stephane.ducasse@inria.fr > 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
I didn't understand if you want to replace the class pragmas with a simple class method for adding metadata, or to add the pragmas in a class method. In the first case I think I would like to have class pragmas because: - we can have a single, well known way, or concept, to generate metadata, which can allow us to: - build tools that can work with class and method pragmas in the same way (not only frameworks, a pragma browser can be benefited by this). If the metadata is disperse we have to know a lot of ways to do the same, or each one will define it's own. And we can't (or it should be difficult to) have tools to work with that metadata uniformly. I don't know why this should be less cheaper than a class method. I don't think this is reaaally hard to do also... :S. It's even simpler than the method pragmas, because we don't have to change the compiler :P. Cheers, Guille On Fri, Jul 9, 2010 at 9:25 PM, <csrabak@bol.com.br> wrote:
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 < stephane.ducasse@inria.fr > 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Hi guille
I didn't understand if you want to replace the class pragmas with a simple class method for adding metadata, or to add the pragmas in a class method.
In the first case I think I would like to have class pragmas because:
- we can have a single, well known way, or concept, to generate metadata, which can allow us to: - build tools that can work with class and method pragmas in the same way (not only frameworks, a pragma browser can be benefited by this).
If the metadata is disperse we have to know a lot of ways to do the same, or each one will define it's own. And we can't (or it should be difficult to) have tools to work with that metadata uniformly.
Did you check setting? Did you check how pragma collection is done? Because it can help me to understand your answer.
I don't know why this should be less cheaper than a class method. I don't think this is reaaally hard to do also... :S. It's even simpler than the method pragmas, because we don't have to change the compiler :P.
Cheers, Guille
On Fri, Jul 9, 2010 at 9:25 PM, <csrabak@bol.com.br> wrote: 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 < stephane.ducasse@inria.fr > 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Haha yeah :). I only was telling that if we chose a non-pragma way to add metadata to a class, we cannot be benefited (simply) with a pragma collector, hehe. But that's because I didn't understand what you meant about using class methods to add metadata. On Sat, Jul 10, 2010 at 4:46 AM, Stéphane Ducasse <stephane.ducasse@inria.fr
wrote:
Hi guille
I didn't understand if you want to replace the class pragmas with a simple class method for adding metadata, or to add the pragmas in a class method.
In the first case I think I would like to have class pragmas because:
- we can have a single, well known way, or concept, to generate metadata, which can allow us to: - build tools that can work with class and method pragmas in the same way (not only frameworks, a pragma browser can be benefited by this).
If the metadata is disperse we have to know a lot of ways to do the same, or each one will define it's own. And we can't (or it should be difficult to) have tools to work with that metadata uniformly.
Did you check setting? Did you check how pragma collection is done? Because it can help me to understand your answer.
I don't know why this should be less cheaper than a class method. I don't think this is reaaally hard to do also... :S. It's even simpler than the method pragmas, because we don't have to change the compiler :P.
Cheers, Guille
On Fri, Jul 9, 2010 at 9:25 PM, <csrabak@bol.com.br> wrote: 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 < stephane.ducasse@inria.fr > 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
ok I see I was thinking using methods (instance or class) with pragmas. Stf
I just said that we do not need a big infrastructure. We have methods / class methods and pragma so it should be enough. Stef On Jul 10, 2010, at 2:25 AM, csrabak@bol.com.br wrote:
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 < stephane.ducasse@inria.fr > 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 Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (11)
-
Alexandre Bergel -
csrabak@bol.com.br -
Eliot Miranda -
Guillermo Polito -
Igor Stasenko -
Lukas Renggli -
Mariano Martinez Peck -
Nicolas Cellier -
Simon Denier -
Stéphane Ducasse -
Torsten Bergmann