I just have to say that string mixins rock

Philippe Sigaud philippe.sigaud at gmail.com
Thu Jul 26 06:52:22 PDT 2012


On Thu, Jul 26, 2012 at 10:32 AM, Russel Winder <russel at winder.org.uk> wrote:
> On Thu, 2012-07-26 at 08:48 +0200, Philippe Sigaud wrote:
> […]
>> Ditto. Took me a while to be convinced (assembling code as strings?
>> Ewww, oh gross!), but now I'm sold.
>
> Dynamic languages have been doing this for ages, and indeed even more
> weird stuff with meta-object protocols.
>
> Just saying ;-)

Fair point, but a few years ago, I had no experience in Lisp, Python
or Ruby. Not even Haskell nor ML. I was a provincial C/C++ user :)
I'm cured of that.

Anyway, do many languages use MOPs ? I thought CLOS/MOP was more
one-of-a-kind curiosity for Common Lisp ? I know Python has
metaclasses, but until know I did not see them as a meta-object
protocol.

So yes, D is still behind Lisp as far as crafting code is concerned
(but what language isn't?), but I think the recent increase in power
for CTFE opened new vistas and we are beginning to see the effect of
that (cue std.regex).

And, we are not *that far* from being able to encode user-defined AST
transformations on D source code, so that people will be able to
define their own syntax.


More information about the Digitalmars-d mailing list