chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] define-macro in Chicken 4.0


From: felix winkelmann
Subject: Re: [Chicken-users] define-macro in Chicken 4.0
Date: Sun, 15 Mar 2009 12:23:48 +0100

On Sat, Mar 14, 2009 at 10:27 AM, Eduardo Cavazos
<address@hidden> wrote:
>
> Well, I have some "portable" Scheme code; i.e. code that runs on a few
> implementations. In that code are some macros which intentionally break
> hygiene. So that rules out syntax-rules. Just about everybody supports
> define-macro so it was easy to achieve portability that way.
> Explicit-renaming macros don't seem to be as widely supported. For example,
> I don't think they're in Ypsilon or Ikarus. Didn't Clinger invent ER macros?
> They better damn well be in Larceny. ;-)

"define-macro" does not work in a Scheme with a hygienic expander
(unless you are willing to accept quite ugly hacks).

>
> So... will syntax-case be offered as an egg?

It should be possible to implement syntax-case on top of ER macros,
but the signature of syntax-case expanders is unfortunately not very
portable:

chicken:

(define-syntax foo
  (lambda (x r c) ...))

syntax-case:

(define-syntax foo
  (lambda (x) ...))

>
> syntax-case is much more widely supported (yeah I know, it's icky) and it
> allows responible bending of hygiene.

You have full control over hygiene with ER macros as well, and I personally
consider them easier to understand (especially with "match") and use than
syntax-case.

I understand the problem of porting legacy code, but I can't offer a solution
right now.


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]