On 5 October 2015 at 14:02, Jan Johansson via Digitalmars-d <[email protected]> wrote: > On Sunday, 4 October 2015 at 23:55:42 UTC, Manu wrote: >> >> On 5 October 2015 at 03:44, Jan Johansson via Digitalmars-d >> <[email protected]> wrote: >>> >>> On Friday, 2 October 2015 at 02:25:21 UTC, Yaser wrote: >>>> >>>> >>>> Are there any critical frameworks or libraries that are holding you back >>>> in fully investing in D? Obviously I think D is an awesome language, but >>>> some frameworks/libraries hold me back, wish I could do everything in D. >>> >>> >>> >>> I'd wish for attributes to be runtime available, not only compiler >>> directives. It could then be used for a number of interesting use cases, as >>> marshaling from and to different formats rather than through API. The >>> attributes could then be supported by libraries. >> >> >> Anything compile time can be made available at runtime if your system >> calls for it. > > > 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.
You can easily make attributes effectively available at runtime by building lists of attributed things at compile time. I don't understand your problem. Describe the goal? I was one of the main guys involved in the introduction of UDA's, and I have managed to use them successfully for most of my needs.
