apparent bug in sample implementation of SRFI 148 William D Clinger (18 Jul 2017 17:17 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (18 Jul 2017 19:01 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (18 Jul 2017 20:53 UTC)
Re: apparent bug in sample implementation of SRFI 148 William D Clinger (18 Jul 2017 23:33 UTC)
Re: apparent bug in sample implementation of SRFI 148 William D Clinger (19 Jul 2017 12:36 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (19 Jul 2017 13:41 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (19 Jul 2017 14:09 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (19 Jul 2017 14:27 UTC)
Re: apparent bug in sample implementation of SRFI 148 William D Clinger (19 Jul 2017 15:42 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (19 Jul 2017 17:34 UTC)
Re: apparent bug in sample implementation of SRFI 148 William D Clinger (19 Jul 2017 20:31 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (19 Jul 2017 21:07 UTC)
Re: apparent bug in sample implementation of SRFI 148 William D Clinger (20 Jul 2017 01:22 UTC)
Re: apparent bug in sample implementation of SRFI 148 William D Clinger (20 Jul 2017 01:37 UTC)
(missing)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (20 Jul 2017 08:01 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (20 Jul 2017 12:53 UTC)
Re: apparent bug in sample implementation of SRFI 148 Al Petrofsky (20 Jul 2017 23:06 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (21 Jul 2017 08:16 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (21 Jul 2017 13:13 UTC)
Re: apparent bug in sample implementation of SRFI 148 Alex Shinn (22 Jul 2017 10:53 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (22 Jul 2017 10:59 UTC)
Re: apparent bug in sample implementation of SRFI 148 Alex Shinn (22 Jul 2017 11:11 UTC)
Re: apparent bug in sample implementation of SRFI 148 Marc Nieper-Wißkirchen (20 Jul 2017 05:44 UTC)
Re: apparent bug in sample implementation of SRFI 148 Takashi Kato (20 Jul 2017 06:48 UTC)

Re: apparent bug in sample implementation of SRFI 148 Takashi Kato 20 Jul 2017 06:48 UTC

> Now it is a mystery to me why I got different results from Chibi and
> Sagittarius when I tried the example yesterday.

Sagittarius has 2 implementation of syntax-rules, one is for (rnrs base)
and the other one is for (scheme base). If you start REPL without -r7
command line option, then it imports (rnrs) to the REPL environment.
And if you do pass the -r7 option, then it imports (scheme base).

OK, now suppose we have the following 2 files:

;; syn-match-r6.scm
(import (rnrs))

(define-syntax foo
  (syntax-rules ()
    ((foo bar x)
     (define-syntax bar
       (syntax-rules (x)
     ((bar c) 'matched)
     ((bar z) 'unmatched))))))

(foo bar c)
(display (bar q)) (newline)

;; syn-match-r7.scm
(import (scheme base) (scheme write))

(define-syntax foo
  (syntax-rules ()
    ((foo bar x)
     (define-syntax bar
       (syntax-rules (x)
     ((bar c) 'matched)
     ((bar z) 'unmatched))))))

(foo bar c)
(display (bar q)) (newline)

Both are identical except the import clauses. And the following is the
result of execution

$ sash -r6 syn-match-r6.scm
matched

$ sash -r7 syn-match-r7.scm
unmatched

The R6RS version of syntax-rules returns matched the same as other R6RS
implementations (Tested on Chez and Racket's plt-r6rs).

The R7RS version returns unmatched and Chibi also returned the same
on my environment. (NB: The R7RS version is based on Chibi's syntax-rules,
so it's not surprising to me)

Interestingly, Gauche with -r7 option returned matched. So not all R7RS
implementations agreed to return unmatched.

Cheers,

--
_/_/
Takashi Kato
E-mail: ktakashi19@gmail.com