What should 'do' do?

From: <jredford_at_lehman.com>
Date: Thu, 02 Mar 95 08:54:34 -0500

I am working on implementing a scheme interpreter for various reasons,
and while working on the semantics of 'do' I was checking to see what
other interpretations were. Given the following code:

(do ((x 5 (+ x 1)))
    ((> x 10) x)
    (if (= x 7) (define uu 88))
    (if (= x 8) (define uu 33))
    (if (= x 9) (display uu) (newline)))

Stk seems to return 89, whcih makes no sense to me. Two other
interpreters take both the obvious posibilities, one complains of UU
being redefined & prints out 33 and returns 11, the other simply
errors on the 'display' claiming UU is an unbound variable.

The R4RS states that on every iteration the loopy variables are bound
to fresh locations, but it is apparently vague on other variables in
this area.

So, firstly I'm reporting a possible bug (STk 2.1.5) and secondly I am
curious what information other people have on the correctness of this.
Are there any documents more precise than R4RS? (Am I the only one who
thinks this document is incredibly vague most of the time? For example,
what does a '(BEGIN <definitions> ...)' actually look like?).

--
John Redford (AKA GArrow) | 3,600 hours of tape.
jredford_at_lehman.com       | 5 cans of Scotchguard.
Received on Thu Mar 02 1995 - 15:01:21 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST