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

Re: are dylan macros Turing-complete?



In article <offq87j7co.church.of.emacs@localhost.verbum.private>,
 Colin Walters <walters@verbum.org> wrote:

> I do note that in the Gwydion Dylan implementation, some macros (such
> as :=), seem to call functions in the compiler to compute their
> expansion:
> 
> define macro \:=
>     { \:= (?place:expression, ?value:expression) }
>       => make-assignment({ ?place }, { ?value })
> end;
> 
> This is not a standard part of the Dylan macro system, correct?  My
> reading of the "Templates" section of the DRM seems to suggest so,
> but I'm not completely sure.

That's not part of the Dylan spec, but you've got to generate your parse 
tree *somewhere*.  In many compilers you'd find almost exactly the same 
thing as a parse rule in a yacc file.  In Dylan, the parser and macro 
expansion interact too much to do that.

-- Bruce