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

Re: are dylan macros Turing-complete?



In article <bruce-63512A.13370411052002@copper.ipg.tsnz.net>,
 Bruce Hoult <bruce@hoult.org> wrote:

> > (with-foo "bar" (baz)) -> (let ((foo-bar ...)) ... (baz)) 
> > 
> > In Scheme I can't compute the foo-bar symbol via
> > macros.
> 
> You can in Dylan.

What would it look like?

> > Another thing that's important (especially for top-level
> > macros) is that Macros can generate compile-time side-effects,
> > which are controlled by the programmer.
> > 
> > Example
> > 
> > (define-function foo (bar) ...)
> > 
> > Expands to (defun foo (bar) ...)
> 
> That's easy in Dylan.

;-) Yeah, the difficult part is described in the paragraph below:

> > and could have, for example, the side effect to enter the
> > function into a database at compile time. This comes very
> > handy, for example, when you develop new (sub-)languages
> > on top of CL and want to do some programming environment
> > stuff on your own. This is also interesting when
> > you want to lookup definitions at compile-time from
> > a database (done with FFIs, foreign function interfaces).
> > Etc.
> 
> You can't do these things at compile-time in Dylan.  You can however do 
> them at program load time.

Which is not really the same.

> There is also a design for adding procedural macros pretty seamlessly to 
> the current pattern replacement macros.  See:
> 
>    http://www.ai.mit.edu/~jrb/Projects/dexprs.pdf

Thanks for the reference.

Haven't (yet) read it, what is the approach? Does one have
full Dylan available at compile-time?