Function name as text
Bill Baxter
dnewsgroup at billbaxter.com
Wed Dec 5 13:50:32 PST 2007
Craig Black wrote:
> OK I think it's possible with mixins but the syntax is ugly. It would be
>
> Event event = mixin(dispatch("&foo.bar"));
>
> Which leads me to an idea that has probably been proposed before. It would
> be nice if I could shorten this to simply
>
> Event event = dispatch(&foo.bar);
>
> There may be reasons why this syntax would be difficult to achieve, but I
> think it would be worthwhile if we could.
>
> Thoughts?
My understanding is that that is exactly what macros are going to do.
Define dispatch as a macro, then its arguments get passed as strings. I
think the main issue is just working out the grammar and all the various
compiler bits to make it work.
--bb
More information about the Digitalmars-d
mailing list