Re: [Chicken-users] two-dimensional syntax-rules

2017-03-11 Thread Alex Shinn
It's not a bug, it's the template which is an error.  See the discussion on
the chibi list:
https://groups.google.com/d/msg/chibi-scheme/7fTzofNrPrI/Yy_aibRdBQAJ

-- 
Alex

On Fri, Mar 10, 2017 at 7:16 PM, Peter Bex  wrote:

> On Fri, Mar 10, 2017 at 11:10:35AM +0100, Sascha Ziemann wrote:
> > 2017-03-10 10:55 GMT+01:00 Peter Bex :
> > >
> > > Gauche and Racket accept this macro application, Scheme48 rejects it
> (but
> > > that's expected, because our syntax-rules is originally from Scheme48).
> > >
> >
> > But Gauche fails like Chibi. They silently ignore the last ellipsis.
>
> Oh, good point.  I didn't think to check the results for correctness :)
>
> I've added this info to a ticket: http://bugs.call-cc.org/ticket/1351
>
> Cheers,
> Peter
>
> ___
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] two-dimensional syntax-rules

2017-03-10 Thread Peter Bex
On Fri, Mar 10, 2017 at 11:10:35AM +0100, Sascha Ziemann wrote:
> 2017-03-10 10:55 GMT+01:00 Peter Bex :
> >
> > Gauche and Racket accept this macro application, Scheme48 rejects it (but
> > that's expected, because our syntax-rules is originally from Scheme48).
> >
> 
> But Gauche fails like Chibi. They silently ignore the last ellipsis.

Oh, good point.  I didn't think to check the results for correctness :)

I've added this info to a ticket: http://bugs.call-cc.org/ticket/1351

Cheers,
Peter


signature.asc
Description: Digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] two-dimensional syntax-rules

2017-03-10 Thread Sascha Ziemann
2017-03-10 10:55 GMT+01:00 Peter Bex :
>
> Gauche and Racket accept this macro application, Scheme48 rejects it (but
> that's expected, because our syntax-rules is originally from Scheme48).
>

But Gauche fails like Chibi. They silently ignore the last ellipsis.

$ chibi-scheme
> (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) ...)
  ...)
> (define-facts (fathero f c)
  (("Abraham" "Ismael")
   ("Abraham" "Isaac")
   ("Isaac"   "Jacob")
   ("Jacob"   "Benjamin")))
(define (fathero f c) (conde ((== f "Abraham") (== c "Ismael")) ((== f
"Abraham") (== c "Isaac"

MIT and Ikarus succeed like Guile.

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


Re: [Chicken-users] two-dimensional syntax-rules

2017-03-10 Thread Peter Bex
On Fri, Mar 10, 2017 at 09:31:38AM +0100, Sascha Ziemann wrote:
> I am not sure if it is a bug, because Chibi and Gambit fail, too. But
> Petite Chez does it like Guile.
> 
> Is it a bug?

Hello Sascha,

At first glance, it looks like a bug to me.  I'll have to investigate
further, because this macro is pretty wicked in how it plays with
ellipsis, so it might be unspecified territory.

Gauche and Racket accept this macro application, Scheme48 rejects it (but
that's expected, because our syntax-rules is originally from Scheme48).

Cheers,
Peter


signature.asc
Description: Digital signature
___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users


[Chicken-users] two-dimensional syntax-rules

2017-03-10 Thread Sascha Ziemann
I have the following macro:

(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) ...)
  ...)

In Guild 2.0.9 it works as expected:

scheme@(guile-user)> (define-facts (fathero f c)
  (("Abraham" "Ismael")
   ("Abraham" "Isaac")
   ("Isaac"   "Jacob")
   ("Jacob"   "Benjamin")))
$1 = (define (fathero f c) (conde ((== f "Abraham") (== c "Ismael"))
((== f "Abraham") (== c "Isaac")) ((== f "Isaac") (== c "Jacob")) ((==
f "Jacob") (== c "Benjamin"

But in Chicken csi get the following error:

CHICKEN
(c) 2008-2013, The Chicken Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.8.0.5 (stability/4.8.0) (rev 5bd53ac)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2013-10-03 on aeryn.xorinia.dim (Darwin)

#;1> (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) ...)
  ...)
#;2> (define-facts (fathero f c)
  (("Abraham" "Ismael")
   ("Abraham" "Isaac")
   ("Isaac"   "Jacob")
   ("Jacob"   "Benjamin")))

Error: (map) during expansion of (define-facts ...) - lists are not of
same length: (() (("Jacob") ("Benjamin")))

Call history:

(##sys#map-n (lambda8 (a1 v01) (##sys#cons (rename14
(##core#syntax ==)) (##sys#cons a1 (##sys#cons v01...
(##sys#cons (rename14 (##core#syntax ==))
(##sys#cons a1 (##sys#cons v01 (quote13 ()
(rename14 (##core#syntax ==))
(##sys#cons a1 (##sys#cons v01 (quote13 (
(##sys#cons v01 (quote13 ()))
(##sys#map-n (lambda8 (v10 a1 v11) (##sys#cons
(##sys#cons (rename14 (##core#syntax ==)) (##sys#cons..
(##sys#cons (##sys#cons (rename14 (##core#syntax
==)) (##sys#cons a0 (##sys#cons v10 (quote13 ()...
(##sys#cons (rename14 (##core#syntax ==))
(##sys#cons a0 (##sys#cons v10 (quote13 ()
(rename14 (##core#syntax ==))
(##sys#cons a0 (##sys#cons v10 (quote13 (
(##sys#cons v10 (quote13 ()))
(##sys#map-n (lambda8 (v11) (##sys#cons (rename14
(##core#syntax ==)) (##sys#cons a1 (##sys#cons v11...
(##sys#cons (rename14 (##core#syntax ==))
(##sys#cons a1 (##sys#cons v11 (quote13 ()
(rename14 (##core#syntax ==))
(##sys#cons a1 (##sys#cons v11 (quote13 (
(##sys#cons v11 (quote13 ())) <--

I am not sure if it is a bug, because Chibi and Gambit fail, too. But
Petite Chez does it like Guile.

Is it a bug?

___
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users