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: Thu, 11 Dec 2008 21:44:44 -0800

On Thu, 2008-12-11 at 18:26 -0500, Aubrey Jaffer wrote:
...
> "mkimpcat.scm" should produce a file named "implcat".  The CATCAT
> procedure at the end of "slib/mklibcat.scm" copies "implcat" onto the
> end of "slib/slibcat".

That is what I thought... but then it didn't actually work (In my
implementation only some comments pointing to implcat appeared to be
added to "slibcat" but not the contents of the implcat itself). This sent
me searching for another place where the contents of implcat could be
loaded.

But upon reading your explanation I went back and dug a bit deeper into
what catcat was doing. As it turns out, my "do" macro was broken for
this case:

(do (<inits>)
    (<test-exp>)
  <body>)

I.e. a do-loop which doesn't have a return value expression with the
test-exp. It turns out that this case is not being covered by the r4rs
test suite, and since I don't use do-loops myself, this bug slipped by
unnoticed all this time.

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)))))
(test 25 'do (let ((x '(1 3 5 7 9))
                   (sum 0))
               (do ((x x (cdr x)))
                   ((and (null? x) sum))
                   (set! sum (+ sum (car x))))))

Thanks again. I was really not looking at the right code until your
message clarified how mklibcat was supposed to work.

Kris





reply via email to

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