[r6rs-discuss] macroexpand

From: Sam TH <samth>
Date: Fri Sep 22 17:15:53 2006

On Fri, 2006-09-22 at 23:57 +0300, Dan Muresan wrote:
> On Fri, September 22, 2006 11:41 pm, Sam TH wrote:
>
> > However, it's a complicated extension to the macro system, which would
> > require careful specification (it's not just exposing the expander).
> > Therefore, it's appropriate not to specify it right now - there's only
> > so much that can be done in one revision.
>
> Right, but if the spec were to restrict macroexpand to the domain of
> define-macro, these complications wouldn't arise.

Why would we want define-macro at all? There are 3 kinds of macros you
might want to write:

1. Simple macros - you can write them in syntax-rule
2. Complex, programmed macros - syntax-case
3. Extremely complex, requiring facilities not described in the original
syntax-case system

In R5RS, you can write the first kind. In R6RS as currently drafted,
you can write the first and second. This is a step forward. If you
want the third kind, you need to use an implementation that provides
those facilities (such as PLT Scheme), just as you had to before the
publication of R6RS.

Eventually, more will be standardized, maybe even including
local-expand. Why is that so problematic?

> Let define-macro, syntax-rules and -case operate in parallel. And let
> macroexpand work only for defined-macros. It's a practical solution, and
> it doesn't prevent future extensions. What would be the disadvantages?

It would introduce a fundamentally broken macro system where previously
we had only working macro systems.

> > Similarly, an FFI is very important for a programming language, but R6RS
> > isn't going to specify one. That isn't a sign the R6RS process is
> > failing, or that we should adopt a half-baked solution so that we can
> > specify something now.
>
> I agree. FFI is not a spec issue. I was just saying that besides
> continuations and a good community, a Lisp would need a good FFI to make
> me switch.

An FFI was just an example of a useful feature that R6RS did not, and
should not be condemned for not, standardizing.

sam th
Received on Fri Sep 22 2006 - 17:16:30 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC