* r5rs pitfall test
@ 2003-02-13 20:05 Dale P. Smith
2003-05-03 20:01 ` Marius Vollmer
0 siblings, 1 reply; 2+ messages in thread
From: Dale P. Smith @ 2003-02-13 20:05 UTC (permalink / raw)
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
dsmith@altustech.com | http://cleveland.lug.net
440-746-9000 x239 |
_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-05-03 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-13 20:05 r5rs pitfall test Dale P. Smith
2003-05-03 20:01 ` Marius Vollmer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).