picrin icon indicating copy to clipboard operation
picrin copied to clipboard

syntax-rules cannot generate symbol with quote syntax

Open okuoku opened this issue 9 years ago • 2 comments

It seems syntax-rules does not allow me to generate symbol... I do not investigate deeply this yet, but AFAIK, Picrin is the only Scheme implementation behave like this...

(import (scheme base)
        (scheme write))

(define-syntax check
  (syntax-rules ()
    ((_) 'hoge)))

(write (check)) (newline)

Yields #<identifier hoge>. Other Scheme should say hoge as symbol.

(In other words, we cannot use case with symbols within syntax-rules in Picrin.

(import (scheme base) (scheme write))

(define-syntax check
  (syntax-rules ()
    ((_ arg)
     (case arg
       ((OK) "OK\n")
       (else "NG\n")))))

(display (check 'OK)) (newline)

ChezScheme, chibi-scheme, Gauche, Guile, Kawa, NMosh, Sagittarius says "OK", picrin says "NG".)

okuoku avatar Aug 11 '16 21:08 okuoku

Verified. This issue will fixed in #347 .

KeenS avatar Aug 12 '16 02:08 KeenS

That is a known issue (and an I-really-want-to-fix-but-failing thing). Given an issue report, I put a priority on fixing this bug. I don't expect it will be done in a short amount of time, though.

nyuichi avatar Aug 12 '16 02:08 nyuichi