Compare do and do*; they are analogous to let and let*.
On Wednesday, January 22, 2003, at 12:26 PM, feilong wrote:
> Hallo friends,
> Why does not this do expression run?
> 1 (do ((x 1 (+ x 1))
> 2 (y x x))
> 3 ((> x 5))
> 4 (format t "(~A ~A) " x y))
> Error: Attempt to take the value of the unbound variable `X'.
> [condition type: UNBOUND-VARIABLE]
>
> I think that the variable y in row 2 can refer to the variable x. In
> the first iteration has x been intialised to 1, while do is parallel
> evaluation, that menas, y can refer to x and assign y to 1. Why does
> intepreter give wrong report.
>
> why does this do expression run?
> (let ((x 'a))
> (do ((x 1 (+ x 1))
> (y x x))
> ((> x 5))
> (format t "(~A ~A) " x y))
> (1 A)
> (2 1)
> (3 2)
> (4 3)
> (5 4)
> NIL
>
> I have only added a "let" expression and in "let" initialised x with
> 'a. In previous "do" expression I have also initialised x with value
> 1. Whether can not y direkt refer to x without "let" to initialise x
> in outmost enviroment? What difference is there in this "do"
> expression with "let" and previous "do" expression without "let"?
>
> Best Greetings
> Xu
>
>
--
Gary Warren King, Senior Research Fellow, EKSL
Callused men in business suits speak computerese
Play pinball with the third world, trying to keep it on its knees
Their single crop starvation plans put sugar in your teas
and the local third world is kept on reservations you can't see
It'll all go back to normal if we put our nation first.
But the trouble with normal is it always gets worse.
-- Bruce Cockburn, Trouble with Normal