Re: trace(1) bug

new topic     » goto parent     » topic index » view thread      » older message » newer message

c.k.lester wrote:
> 
> CChris wrote:
> 
> > Currently, a for loop index should not exist prior ("attempt to redefine
> > i");
> > I don't see any problem in changing this so that the loop index shadows
> > anything
> > with the same name as long as it is alive, except another for loop index.
> 
> The current behavior prevents me from accidentally assigning a loop value
> to a currently existing variable. I'd like to keep that behavior.

Well I have no fixed opinion on this actually. Pete seems to wish he could
predeclare an integer i. The iterate loop would serve him right I think. But
again, I'll apply this specific small change only if there's consensus about it.
It wouldn't fix anything.

> For the
> other consideration, iterate() would be a good name.
> 
> integer i
> 
> iterate(i,1,2,<10) do -- (variable,start,step,continue condition)
>   ?i -- 1, 3, 5, 7, 9
> end iterate
> ?i  -- 11
> 
> That's the general idea.

I was thinking more along the line of }}}
<eucode>iterate i=1 to n by p do</eucode>
{{{
,
just like a for loop, but with the semantic differences underlined earlier.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu