slib-discuss
[Top][All Lists]
Advanced

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

Re: [Slib-discuss] Proper way to add one's own "impcat" to Slib


From: Kris De Volder
Subject: Re: [Slib-discuss] Proper way to add one's own "impcat" to Slib
Date: Sat, 13 Dec 2008 09:25:56 -0800

On Sat, 2008-12-13 at 00:39 -0500, Aubrey Jaffer wrote:
> | From: Kris De Volder <address@hidden>
>  | So, I propose to add the following two test cases to r4rstest.scm:
>  | 
>  | (SECTION 4 2 4)
>  |  ... 
>  | 
>  | (test 25 'do (let ((x '(1 3 5 7 9)))
>  |           (do ((x x (cdr x))
>  |                (sum 0 (+ sum (car x))))
>  |               ((and (null? x) sum)))))

> Both of your do expressions return an unspecified value according to
> R4RS and R5RS:
> 
>  -- library syntax: (do ((<variable1> <init1> <step1>) ...)
>                       (<test> <expression> ...)
>                     <command> ...)

You are right. It appears I was sloppy writing these tests. Sorry about
that. 

Nevertheless I think it would still be a good idea to add a test that
exercises the case where no expressions follow the <test>.

(test 25 'do (let ((x '(1 3 5 7 9))
                   (sum 0))
                (do ((x x (cdr x)))
                    ((null? x))
                  (set! sum (+ sum (car x))))
                sum))

This test doesn't assume anything of the value returned by the do loop.
There currently is no test in r4rstest.scm that doesn't have an
expression after the test.

Kris





reply via email to

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