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

Re: [Scheme-reports] auxiliary syntax

A few minutes ago, Alaric Snell-Pym wrote:
> Well, his goal is perhaps a little higher level; he wants to write a
> macro that interprets the body of the macro invocation in a certain
> way, namely as just a datum rather than with the emotional baggage
> of Scheme source code.

See other reply.  If there's no mixing of scheme code with the macro
code, then there's no problem and you could just use a string or
whatever.  The point is (usually) that you want such mixing.

> Now, when used with the original "matches" or "compile" procedures,
> the patterns are going to be quoted literals if they're not read or
> computed from somewhere else.  And so they use the unhygiene of the
> quote macro/special form.

Yes, at that point it's plain (runtime) data.  Just like symbols (not

> One might say that such poor hygiene should be limited only to quote
> (and quasiquote?), and so users must use run-time compilation and
> not use macros for this kind of DSL;

No, it's just that the whole point of macros is to extend an existing
language, not implement a new unrelated one.

> So, are you saying that quote is unschemely, or that macros which
> follow the kind of general DSL pattern I consider above are
> unschemely, or neither and I'm completely
> misunderstanding/misrepresenting you? :-)

To clarify what I'm saying, see my point about

  (foo "macro body here")

It's perfectly fine to define DSLs this way, but that's not something
that macros help you much.  (You get a tiny help in the form of being
able to run stuff at compile time, but that's not a big deal these
days.)  The main point of macros is in mixing languages -- scheme,
your DSL, and someone else's.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Scheme-reports mailing list