How to complex switch?

Timon Gehr timon.gehr at gmx.ch
Thu May 12 07:19:13 PDT 2011


Matthew Ong wrote:
> == Quote from dennis luehring (dl.soluz at gmx.net)'s article
> > Am 12.05.2011 14:58, schrieb Matthew Ong:
>
> > did you see the string mixin feature before?
> > http://www.digitalmars.com/d/2.0/mixin.html
> > no outer (parsing) generator needed anymore (with small exceptions) :)
>
> I fail to see what is being addressed here in relation to switch.
> What you have shown me is about Regexp and Mixin.
> Is mixin related to code generations or switch or...?
> Is there a way for you to show some sample code that demo what you wants to say?

I think he was referring to the fact that D's mixin and import allow you to write
lightweight "parsers" for your own Domain Specific Languages.

mixin(strange_switch_supporting_DSL_to_D(import("filename")));

I do not really see the value added to D by such a construct either btw.
Its uses would be very rare while it would add some heavy complexity to the
compiler. Not to mention regex support would have to become built-in etc.

Timon



More information about the Digitalmars-d mailing list