[r6rs-discuss] macroexpand

From: Dan Muresan <dan-r6rs>
Date: Fri Sep 22 17:51:29 2006

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

I'm using Scheme today to write web applications. R7RS is a few years away.

I use macroexpand where it's present and fragile hacks where it's not
present. I wish I could count on macroexpand being there. It's easy to
implement.

Perhaps I'll look again at PLT. For now I like SISC because it can easily
access the vast Java libraries.

Couldn't we just call macroexpand "local-expand" and specify that for now
it works only on certain macros, with the option of extending it in the
future?

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

Broken? It depends where you come from. Let's proceed chronologically.

First, there was define-macro and macroexpand. These tools were sometimes
dangerous, but had all the expressive power anyone could ask for.

Syntax-rules broke Scheme by allowing only the simplest of macros to be
defined. Would it not have been more responsible to leave define-macro in
R5RS until its capabilities could be replicated by more advanced systems?

syntax-case alleviates the pain, but comes with a huge complex burden
(no-one will argue that it's a breeze, I think). This burden has the
concrete consequence of making macroexpand unspecifiable, as you argue
yourself.

Do you at least see where I come from? What broke what?

If a power user uses define-macro, he knows the dangers -- no need for the
language to hold hands. Newbies can use syntax-rules, and purists can use
syntax-case.


Dan Muresan
http://alumnus.caltech.edu/~muresan
Received on Fri Sep 22 2006 - 17:51:18 UTC

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