[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Bug shadowing syntactic keyword

From: Thomas Bushnell BSG
Subject: [Chicken-hackers] Bug shadowing syntactic keyword
Date: Mon, 20 Jul 2009 23:56:03 -0700

I'm using version 3.4.  No idea if 4.0 has this bug.

>From the r5rs pitfalls, we have the following test, originally from


((lambda (x) (x 1 2 3)) (lambda args args))

The argument procedure returns its arguments, so when passed to the
subject procedure, we get (1 2 3) as we should.

We can replace "x" with other identifiers, and have no problem:
((lambda (let) (let 1 2 3)) (lambda args args))
((lambda (lambda) (lambda 1 2 3)) (lambda args args))

But if we try "begin" as the formal, it fails interestingly:
((lambda (begin) (begin 1 2 3)) (lambda args args))
  => ((1 2 3))

And if we try "define" as the formal, we get a spinning infinite loop of
some kind:
((lambda (define) (define 1 2 3)) (lambda args args))
  => never returns

According to the original discussion on comp.lang.scheme,,
MzScheme, Chez Scheme, and Kawa Scheme get this right, but MIT Scheme
got it wrong back then.  I can confirm that scm (and guile) get it
right.  It is a shame that Chicken gets it wrong!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]