guile-devel
[Top][All Lists]
Advanced

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

r5rs pitfall test


From: Dale P. Smith
Subject: r5rs pitfall test
Date: Thu, 13 Feb 2003 15:05:07 -0500

I saw this on comp.lang.scheme and thought I'd try it out:

http://sisc.sourceforge.net/r5rspitresults.html

Guile fails tests 1.1 and 2.1

The results (after commenting out 2.1) are:

Failure: 1.1, expected '0', got '1'.
Passed: 1.2
Passed: 1.3
Passed: 3.1
Passed: 3.2
Passed: 4.1
Passed: 4.2
Passed: 5.1
Passed: 5.2
Passed: 5.3
Passed: 6.1
Passed: 7.1
Passed: 7.2
Passed: 7.3
Passed: 7.4
Map is not call/cc safe, but probably tail recursive and efficient.

Including 2.1:

Failure: 1.1, expected '0', got '1'.
Passed: 1.2
Passed: 1.3
<unnamed port>: In expression (0 (syntmp-c-42 1)):
<unnamed port>: Wrong type to apply: (0 (syntmp-c-42 1))

The code for 1.1 is:
;;Credits to Al Petrofsky
(should-be 1.1 0
 (let ((cont #f))
   (letrec ((x (call-with-current-continuation (lambda (c) (set! cont c) 0)))
            (y (call-with-current-continuation (lambda (c) (set! cont c) 0))))
     (if cont
         (let ((c cont))
           (set! cont #f)
           (set! x 1)
           (set! y 1)
           (c 0))
         (+ x y)))))

The code for 2.1 is:
;;Credits to ???, (and a wink to Matthias Blume)
(should-be 2.1 1
 (call/cc (lambda (c) (0 (c 1)))))

For 2.1, it appears that apply is checking to see if 0 is a procedure
before it evaluates the arguments.

I don't understand why 1.1 returns 1.

These errors should probably be fixed and added to the regression tests.

-Dale

-- 
Dale P. Smith
Senior Systems Consultant,      | Treasurer,
Altus Technologies Corporation  | Cleveland Linux Users Group
address@hidden            | http://cleveland.lug.net
440-746-9000 x239               |




reply via email to

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