It's not a "strange tag" .. it's an attribute.
 
Attributes are classes representing metadata which can be inspected at runtime. 
 They're very powerful -- see "Applied .NET Attributes" by Bock & Barnaby.  
They're used to mark classes as serializable, by the serializer to adjust how 
serialization takes place, by ASP.NET to mark whether or not to expose a method 
in a Web Service, by data access layers to mark what tables and fields classes 
and properties map to, by aspect-oriented frameworks to insert context 
interceptors, and so on.  They're also apparently used by AutoCAD to determine 
which methods are exposed, and what name to map them to.  
 
Really, attributes need to have more air time:  anywhere there's information 
*about* a class or method, they could be used rather than creating more members 
that are used only by convention (muddying up the API).  Were IronPython *not* 
trying to be so transparent to CPython developers, I imagine doc strings and 
the like would end up as attributes, rather than reserved members.  I would 
certainly be lobbying for as much (and I wouldn't mind it, still .. __doc__ can 
remain a Python-ism, within the Python language, and be translated to an 
attribute inspection -- hint hint).
 
Here's one article on the subject.  You're certain to find others: 
http://www.devarticles.com/c/a/ASP.NET/Demonstrating-Attributes-and-Reflection-in-.NET/1/
 
To my knowledge, this is a yet-to-be-implemented feature of IronPython, and I'm 
not sure where it falls in relation to the other items for v1.

________________________________

From: [EMAIL PROTECTED] on behalf of Tim Riley
Sent: Thu 7/7/2005 12:09 PM
To: Discussion of IronPython
Subject: [IronPython] Two Questions



I am looking to make IronPython .NET assemblies to load into AutoCAD.
I know at this point in time there isn't a static compiler for
IronPython but it would be nice to know how much of a priority this is
and an ETA would be really nice. In order to use the assemblies in
AutoCAD I need to compile them to a .dll.

Another weird thing I saw in sample code for AutoCAD .NET assemblies
is some strange tag for defining user commands in AutoCAD.

For C# it is:
[CommandMethod("helloworld")]
public void HelloWorld()


And in VB.NET it is:
<Autodesk.AutoCAD.Runtime.CommandMethod("HELLO")> _
Public Function HelloCommand()


<<winmail.dat>>

_______________________________________________
users-ironpython.com mailing list
users-ironpython.com@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to