The future of UDAs.
Gor Gyolchanyan
gor.f.gyolchanyan at gmail.com
Tue Nov 27 04:36:51 PST 2012
It has to be in a single function. Suppose you have a variety of modules
each of which has a variety of types. And you need to compose a
compile-time string which involves all those types and you need to mix that
string in at some point. You can't do that.
On Tue, Nov 27, 2012 at 4:33 PM, Jacob Carlborg <doob at me.com> wrote:
> On 2012-11-27 12:28, Gor Gyolchanyan wrote:
>
>> Basically the most important thing I miss is mutable compile-time
>> variables. That's it. Everything else can be worked around.
>>
>
> This compiles just fine and prints "10" at compile time:
>
> int foo ()
> {
> int i = 0;
> for (; i < 10; i++) {}
> return i;
> }
>
> enum i = foo();
> pragma(msg, i);
>
> --
> /Jacob Carlborg
>
--
Bye,
Gor Gyolchanyan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121127/c895fd2b/attachment.html>
More information about the Digitalmars-d
mailing list