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

(do ((var init)) (...))

I've heard no one insisting on the (do ((var)) ...) syntax, so I'm going
to flush it, for consistency with LET.  A few people say they like (do
((var init)) ...), so I'll leave it in.  But there's one little issue
which needs to be clarified: does the var get a new binding every time
around the loop, or does it get just one binding at the beginning?  That
is, is there an outer LET for the variables which aren't stepped, or is
(var init) the same as (var init var)?  It makes a difference if
closures are created in the loop.

The easiest way to write the macro expander is to make (var init) be the
same as (var init var).  I think this is what ancient scheme
interpreters like NSCHSY did, and it's certainly what T does.  I don't
know about any other implementation.  This is the interpretation that I
prefer - it's easier to describe and more useful and elegant.  Speak up
if you believe this is wrong.