[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-janitors] #1351: syntax-rules has difficulty handling ellip
From: |
Chicken Trac |
Subject: |
Re: [Chicken-janitors] #1351: syntax-rules has difficulty handling ellipsis in some cases? |
Date: |
Fri, 10 Mar 2017 10:15:58 -0000 |
#1351: syntax-rules has difficulty handling ellipsis in some cases?
---------------------------------+--------------------------
Reporter: sjamaan | Owner: sjamaan
Type: defect | Status: new
Priority: major | Milestone: someday
Component: expander | Version: 4.12.0
Resolution: | Keywords: syntax-rules
Estimated difficulty: hard |
---------------------------------+--------------------------
Description changed by sjamaan:
Old description:
> As [http://lists.nongnu.org/archive/html/chicken-
> users/2017-03/msg00003.html reported by Sascha Ziemann], this macro
> application fails while it ought to succeed:
>
> {{{
> (define-syntax define-facts
> (syntax-rules ()
> ((_ (name a0 a1 ...) ((v00 v01 ...) (v10 v11 ...) ...))
> '(define (name a0 a1 ...)
> (conde
> ((== a0 v00) (== a1 v01) ...)
> ((== a0 v10) (== a1 v11) ...)
> ...)))))
> }}}
>
> The failing application:
>
> {{{
> (define-facts (fathero f c)
> (("Abraham" "Ismael")
> ("Abraham" "Isaac")
> ("Isaac" "Jacob")
> ("Jacob" "Benjamin")))
> }}}
>
> A few other Schemes have difficulty with it, notably Chibi and Gambit.
> Gauche, Racket and Guile work fine.
New description:
As [http://lists.nongnu.org/archive/html/chicken-
users/2017-03/msg00003.html reported by Sascha Ziemann], this macro
application fails while it ought to succeed:
{{{
(define-syntax define-facts
(syntax-rules ()
((_ (name a0 a1 ...) ((v00 v01 ...) (v10 v11 ...) ...))
'(define (name a0 a1 ...)
(conde
((== a0 v00) (== a1 v01) ...)
((== a0 v10) (== a1 v11) ...)
...)))))
}}}
The failing application:
{{{
(define-facts (fathero f c)
(("Abraham" "Ismael")
("Abraham" "Isaac")
("Isaac" "Jacob")
("Jacob" "Benjamin")))
}}}
A few other Schemes have difficulty with it, notably Chibi, Gauche,
Scheme48 and Gambit (the former two returning the wrong result and the
latter two giving an error). Racket, MIT, Ikarus and Guile work fine.
--
--
Ticket URL: <https://bugs.call-cc.org/ticket/1351#comment:1>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.