[Prev][Next][Index][Thread]

Re: Need Help with Macros



Thanks Neel,

That did the trick!

I guess I got caught thinking to "text oriented" instead of remembering that
Dylan's macro system works at the lexical/syntactic level.


Ron Franke-Polz


Neel Krishnaswami wrote in message ...

[snip]
>
>To convert a name to a string, try this:
>
>  define macro attribute-definer
>      { define attribute ?identifier:name (?type:name) }
>       => {
>           define inline method ?identifier (a :: ?type)
>               a.attributes[ ?"identifier" ];
>           end method;
>
>           define inline method ?identifier ## "-setter" (v :: <object>,
>                                                          a :: ?type)
>               a.attributes[ ?"identifier" ] := v;
>           end method;
>         }
>  end macro;
>
[snip]
>
>
>Neel





References: