seanjensengrey / mosh-scheme

Automatically exported from code.google.com/p/mosh-scheme
Other
0 stars 0 forks source link

expansion of SYNTAX holding a list in fender should be a list of syntax objects when at least one element is a pattern variable #138

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the program:

(import (rnrs))

(define-syntax doit
  (lambda (stx)
    (syntax-case stx ()
      ((_ a b c)
       (for-all identifier? (syntax (a b c)))
       #'(begin 'yes))
      (_
       #'(begin 'no)))))

(write (doit x y z))(newline)
(write (doit x 2 z))(newline)

What is the expected output? What do you see instead?
It should print:

yes
no

instead it fails with:

 Condition components:
 1. &assertion
 2. &who             who: for-all
 3. &message         message: "traversal reached to non-pair element
#<stx() #1=(top) [... a lot of garbage ...]
error     error in raise: returned from non-continuable exception

 Exception:
     error in raise: returned from non-continuable exception

 Stack trace:
    1. throw: <subr>
    2. (raise c):  compiler-with-library.scm:943
    3. apply: <subr>
    4. (lambda stx): <unknown location>
    5. (do-macro-call transformer expr):  psyntax.scm:10
    6. (lambda (ci1d83 ci1d85 ci1d87) ...):  psyntax.scm:10
    7. apply: <subr>

What version of the product are you using? On what operating system?
Mosh R6RS scheme interpreter, version 0.2.4 (revision master 
mosh-0.2.4-4-g5896879dirty).  i686-pc-linux-gnu. 

Please provide any additional information below.
The problem is that (syntax (a b c)) should expand to a list of syntax
objects, because a, b and c are pattern variables.  Checkout with Petite
Chez, Larceny and Ypsilon which do the correct thing; Ikarus has the same
problem (psyntax failure?).

Original issue reported on code.google.com by mrc....@gmail.com on 23 Apr 2010 at 6:43

GoogleCodeExporter commented 9 years ago

Original comment by hige...@gmail.com on 25 Apr 2010 at 5:19

GoogleCodeExporter commented 9 years ago
Thank you for your report.
It may be a bug on upstream(psyntax).

I follow the fix on upstream.

Original comment by hige...@gmail.com on 26 Apr 2010 at 8:39

GoogleCodeExporter commented 9 years ago

Original comment by hige...@gmail.com on 31 Jan 2011 at 2:13

GoogleCodeExporter commented 9 years ago

Original comment by hige...@gmail.com on 1 Feb 2011 at 8:51

GoogleCodeExporter commented 9 years ago
It's worth noting that Guile, which is now psyntax-based, behaves correctly 
here.  OTOH Mosh and Guile's psyntax versions are fairly diverged.

Original comment by amoe...@gmail.com on 12 Apr 2011 at 9:15

GoogleCodeExporter commented 9 years ago
Still remains at 0.2.7. Psyntax-mosh only.

Original comment by oku...@gmail.com on 2 Jul 2011 at 6:28