How would you do this in D?

so so at so.so
Wed May 11 04:57:58 PDT 2011


> Just use a static variable inside a function parameterized by __FILE__  
> and __LINE__. Indeed the drawback is that two every() calls in one line  
> will share that static. I consider it a small matter. If it becomes a  
> bear we may as well add __COLUMN__ or something similar.

__COLUMN__ would be a very nice addition.
Not an everyday usage but there was this unorthodox approach on UI coding,  
immediate mode, which i quite like.
The problem was the id generation. There were solutions, but either not  
enough or too verbose.

With default template args and __F,L,C__ we would have a pretty good  
solution for this particular problem and similar issues.
I don't know, maybe there are already some neat solutions to this in D.
 


More information about the Digitalmars-d mailing list