Steven Schveighoffer <[email protected]> wrote:

This is one of the only reasons I think we need a macro system. Mixins can do this, but who wants to always write mixin when doing logging?

lazy is traditionally used, but it has costs as well. The best solution is to have a macro that converts:

log.info(msg);

directly into:

if(log.level >= info) log.output(msg);

which doesn't require lazy and is exactly what you *should* write.

This would, at least to an extent, be covered by my enhancement request
at http://d.puremagic.com/issues/show_bug.cgi?id=3666.

That said, proper macros is one of the things I want the most for D.

--
Simen

Reply via email to