suggestion: a shorter convenience form Per Bothner (22 Jun 2006 19:42 UTC)
Re: suggestion: a shorter convenience form Jens Axel Søgaard (25 Jun 2006 08:14 UTC)
Re: suggestion: a shorter convenience form Per Bothner (25 Jun 2006 14:27 UTC)
Re: suggestion: a shorter convenience form Jens Axel Søgaard (25 Jun 2006 15:49 UTC)
Re: suggestion: a shorter convenience form Per Bothner (26 Jun 2006 23:56 UTC)
Re: suggestion: a shorter convenience form Jens Axel Søgaard (27 Jun 2006 09:00 UTC)
Re: suggestion: a shorter convenience form Per Bothner (27 Jun 2006 14:55 UTC)

suggestion: a shorter convenience form Per Bothner 22 Jun 2006 19:41 UTC

A problem with define-syntax+syntax-case is that you
get very verbose syntax definitions, with lots of
standard boiler-plate.  This makes syntax definitions
needlessly hard to read and (less important) more tedious to
write.  This has tempted some of my Kawa users to use the "legacy"
non-hygienic define-macro form, even though I discourage it.
Even plain R5RS define-syntax+syntax-rules is
ridiculously verbose.

One idea I had has this little conveniece macro:

(define-syntax define-syntax-case
    (syntax-rules ()
      ((define-syntax-case name literals . parts)
       (define-syntax name
         (lambda form
          (syntax-case form literals . parts))))))

Typical use - especially nice if #` is availiable:

(define-syntax-case NAME ()
   ((_ PVAR ...)
   #`(... PVAR ...))

Of course people can define this themselves, but
it is nicer if it is standard, because then people
get used to reading it.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/