larcenists / larceny

Larceny Scheme implementation
Other
201 stars 32 forks source link

R6RS extended semantics for ellipses doesn't work #515

Open larceny-trac-import opened 11 years ago

larceny-trac-import commented 11 years ago

Reported by: will on Thu Dec 27 09:56:00 2007 As reported by Ryan Newton.

The following should work:

(define-syntax foo
  (lambda (x)
    (syntax-case x ()
     [(_ (Var ...) (Var2 ...) ...)
      #'(quote
        (([Var ... Var2 ...]) ...))])))

Then

(display (foo (1 2 3) (a b c) (d e f)))

should display

(((1 2 3 a b c)) ((1 2 3 d e f)))

In ERR5RS/R6RS modes, however, Larceny rejects the macro definition:

Error: syntax-violation: syntax: Too many ...'s (Var ... Var2 ...)

In R5RS mode, Larceny accepts an analogous syntax-rules definition but then rejects uses of that macro. That behavior appears to be technically correct for R5RS, but it would probably be a good idea to make Larceny's implementation of R5RS syntax-rules consistent with the R6RS semantics.

larceny-trac-import commented 11 years ago

Author: will The ERR5RS/R6RS bug was fixed by changeset:5269, incorporating Andre van Tonder's changes to r6rs-expander.sch.

The R5RS behavior remains the same, so I'm leaving this ticket open. For R5RS mode it is more of an enhancement than a bug, so I'm lowering the priority to minor and changing the milestone.