From: Peter Seibel
Subject: Another LOOP question
Date: 
Message-ID: <m31xzsxpp3.fsf@javamonkey.com>
Okay, so I figured out myself why LOOP can't deduce out that:

  (loop for i from 10 to 0 ...)

implies decremental stepping. (The old compile-time/run-time dichotomy
strikes again!)

But for the life of me I can't figure out why there's no default for
the 'form1' in a for-as-arithmetic subclause when stepping
decrementally. That is, is there some deep reason why:

  (loop for i downto -10 ...)

can't start i at 0 the same way 

  (loop for i upto 10 ...) 

does? Or is it a case of, that's just the way it is?

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

  The intellectual level needed   for  system design is  in  general
  grossly  underestimated. I am  convinced  more than ever that this
  type of work is very difficult and that every effort to do it with
  other than the best people is doomed to either failure or moderate
  success at enormous expense. --Edsger Dijkstra
From: Wolfhard Buß
Subject: Re: Another LOOP question
Date: 
Message-ID: <m3k7dkgpci.fsf@buss-14250.user.cis.dfn.de>
Peter Seibel <·····@javamonkey.com> writes:

> But for the life of me I can't figure out why there's no default for
> the 'form1' in a for-as-arithmetic subclause when stepping
> decrementally. That is, is there some deep reason why:
> 
>   (loop for i downto -10 ...)
> 
> can't start i at 0 the same way 
> 
>   (loop for i upto 10 ...) 
> 
> does? Or is it a case of, that's just the way it is?

Bottom-up iteration over sequences usually starts with index 0.
Top-down iteration usually starts with the last element of a
sequence. A default constant value for the index of that element
is not known yet. :)

-- 
"Hurry if you still want to see something. Everything is vanishing."
                                       --  Paul C�zanne (1839-1906)