Hi there,
When writing syntax-case macros, often one would write:
(define-syntax foo
(lambda (bar)
(syntax-case bar ...)))
This seems overly long-winded; it would be preferable to be able to
write, instead:
(define-syntax (foo bar)
(syntax-case bar ...))
Attached
Hello,
I agree that this is much shorter, but I'm worried about defining the
short syntax in a way that forces you to choose between syntax-rules
and syntax-case. What I mean is that you could just as easily have
(define-syntax (foo bar)
...)
expand to
(define-syntax foo
(syntax-rules ()
On Sun, Jul 03, 2011 at 04:44:46PM -0400, Noah Lavine wrote:
I agree that this is much shorter, but I'm worried about defining the
short syntax in a way that forces you to choose between syntax-rules
and syntax-case.
Except, it doesn't. My version doesn't insert either syntax-case or
Except, it doesn't. My version doesn't insert either syntax-case or
syntax-rules; it just inserts the lambda and lets you do whatever.
Oh, I must have been temporarily insane. My apologies. :-)
Your idea makes a lot of sense.
Noah
Looks fine to me. When I started writing portable R6RS code instead of
PLT Scheme specific code, this was one thing I missed quite often. Not
because it couldn't be done, but because I wanted to avoid having to do
(import (except (rnrs) define-syntax)
(utils))
every single time I wanted