On Monday, 5 October 2015 at 04:02:58 UTC, Jan Johansson wrote:
Sure it can, but I want a dynamic behavior, not a static behavior. Attributes are compiler directives. They are not available at runtime according to the specification of D language. Now take the example at: http://ddili.org/ders/d.en/uda.html, and separate the code into one library that defines the attributes and "printAsXML", keep the consumer of the attributes (main function) and get the same slick functionality. It can't be done, because UDA is not runtime available.

printAsXML is templated on the input type and hence can access all its attributes at compile time. If you're familiar with WCF, you should know that all types going through a data contract are known at compile time.

Reply via email to