digitalmars.D - Attributes
- Craig Black (10/10) Dec 22 2006 C# has a feature called "attributes" that allows metadata to be extended
- Chris Nicholson-Sauls (9/22) Dec 22 2006 Actually I'm inclined to agree that it has its uses. Among the changes ...
- Daniel Keep (3/34) Dec 23 2006 '@' already has a use... CWEB (and by extension, DWEB) uses it. :P
with custom information. This would be very useful in D. Basic support for attributes in D would be possible by adding an array of objects to the TypeInfo class. Developers would need the ability to add attributes, and retrieve attributes from this array. This feature seems easy to implement and has a great deal of utility. Without boring anyone with details, it would make my code much more elegant in many ways. It would also open up some interesting new possiblities including fast dispatch for multimethods. -Craig
Dec 22 2006
Craig Black wrote:with custom information. This would be very useful in D. Basic support for attributes in D would be possible by adding an array of objects to the TypeInfo class. Developers would need the ability to add attributes, and retrieve attributes from this array. This feature seems easy to implement and has a great deal of utility. Without boring anyone with details, it would make my code much more elegant in many ways. It would also open up some interesting new possiblities including fast dispatch for multimethods. -CraigActually I'm inclined to agree that it has its uses. Among the changes my Bovis projects makes from its predecessor is adding of attributes to objects. (As symbols whose value is presence/absence. A Bovis Object either is or is not '__Core, or '__Class, or '__Int, etc.) One would almost need a new operator/surrogate for this purpose. And one has to decide if attributes are a compile-time or run-time feature, whether they apply to the type, the variable, or both... etc. Maybe here at last is a use for the poor character? ;) Just thinking "aloud". -- Chris Nicholson-Sauls
Dec 22 2006
Chris Nicholson-Sauls wrote:Craig Black wrote:' ' already has a use... CWEB (and by extension, DWEB) uses it. :P -- Danielwith custom information. This would be very useful in D. Basic support for attributes in D would be possible by adding an array of objects to the TypeInfo class. Developers would need the ability to add attributes, and retrieve attributes from this array. This feature seems easy to implement and has a great deal of utility. Without boring anyone with details, it would make my code much more elegant in many ways. It would also open up some interesting new possiblities including fast dispatch for multimethods. -CraigActually I'm inclined to agree that it has its uses. Among the changes my Bovis projects makes from its predecessor is adding of attributes to objects. (As symbols whose value is presence/absence. A Bovis Object either is or is not '__Core, or '__Class, or '__Int, etc.) One would almost need a new operator/surrogate for this purpose. And one has to decide if attributes are a compile-time or run-time feature, whether they apply to the type, the variable, or both... etc. Maybe here at last is a use for the poor character? ;) Just thinking "aloud". -- Chris Nicholson-Sauls
Dec 23 2006