unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Dale P. Smith" <dsmith@altustech.com>
Subject: r5rs pitfall test
Date: Thu, 13 Feb 2003 15:05:07 -0500	[thread overview]
Message-ID: <20030213150507.394a936c.dsmith@altustech.com> (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


             reply	other threads:[~2003-02-13 20:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-13 20:05 Dale P. Smith [this message]
2003-05-03 20:01 ` r5rs pitfall test Marius Vollmer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030213150507.394a936c.dsmith@altustech.com \
    --to=dsmith@altustech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).