[REBOL] Re: for bug?
From: joel:neely:fedex at: 17-Jun-2002 8:49
Hi, again, Romano and list,
Joel Neely wrote:
> Romano Paolo Tenca wrote:
> >
> >
> > until [
> > ...
> > i >= 255
> > ]
> >
>
> The problem with post-condition tests is their inability to
> "do nothing gracefully". In the case
>
> >> for i 3 2 1 [print i]
> == none
>
> which can be understood as
>
> print each number i in the range [3 <= i <= 2] stepping by 1
>
> nothing should print, because the range is empty.
>
...
> IMHO any effort to redefine the behavior of FOR should address
> the following issues:
>
...
> - minimizing overhead (maximizing performance)
>
It is interesting that replacing
while [op end start] [
start: start + bump
]
with
if op end start [
until [
start: (old: start) + bump
]
]
would actually appear to improve performance, as well as addressing
Romano's issue with #"^(ff)" as an upper loop bound.
-jn-