D and the world

Jari-Matti Ma"kela" jmjmak at utu.fi.invalid
Wed Apr 25 12:23:52 PDT 2007


eao197 wrote:

> I'm affraid there is some point of misunderstanding of possible usages
> of metaprograming in languages like Nemerle. Just take DSL as example.
> Nemerle allows to include DSL with different syntax into ordinary
> Nemerle program. For example try to imagine inclusion of ASN.1
> fragment[1] into code:
> 
>     ASN1 class OrderForStock ::= SEQUENCE {
>       order-no INTEGER,
>       name-address BranchIdentification,
>       details SEQUENCE OF SEQUENCE {
>          item OBJECT IDENTIFIER,
>          cases INTEGER },
>       urgency ENUMERATED {
>          tomorrow(0),
>          three-day(1),
>          week(2)
>       } DEFAULT week,
>       authenticator Security-Type
>     }
> 
> where 'ASN1' is start of Nemerle syntax macro**.
> 
> But Nemerle allow to use all power of language in macro processing

Does it offer builtin facilities for parsing the macro code, if it's of
some unknown syntax or does it set some limits to the syntax? Or is it
handled as a string as in D?

>(for example it is possible to open and read files in compile-time,

Well, this is possible in D now too.

> Or may be ASN.1 is not a DSL for which D's mixin is meant for?

No, this is exactly the kind of DSL I would like to see embedded in
programs written in D.



More information about the Digitalmars-d mailing list