Subject: Re: assignment to iteration control variables in loop?
From: Erik Naggum <erik@naggum.net>
Date: Wed, 20 Feb 2002 13:37:48 GMT
Newsgroups: comp.lang.lisp
Message-ID: <3223201071978240@naggum.net>

* Bulent Murtezaoglu <bm@acm.org>
| I have spent some time reading the Hyperspec section 6.1 but was unable
| to  find whether assignment to iteration control variables in the body is
| allowed.

  More important than "allowed", what would you want it to mean?  Is an
  assignment likely to have only one possible meaning or multiple?  If the
  latter, common sense dictates that you do not use such assignment.  If
  you assume that it has only one possible meaning, this can be refuted by
  experiment with existing implementations.

| I don't want to do this, I just want to see if the loop macro can
| legally infer the type (and thus insert a declaration) (integer 1 10)
| from that for clause.

  That certainly seems warranted _unless_ some form in the body of the loop
  assigns to the variable.  If the variable binding is special, I think it
  is unwarranted to make any sort of declaration.

| Is there verbiage that proscribes assignment to these variables (like
| there is for object traversing)?

  Not that I know of.

///
-- 
  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief.