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

Re: [zzdev] To loop or not to loop?



Tuukka Hastrup wrote:
> On  9 Aug, Benjamin Fallenstein wrote:
> > Tuukka Hastrup wrote:
> > Huh? No, it wouldn't be clearer to have a "loop" command. It's much,
> > much clearer just to have the thing loop. It's one of the places where
> > having loops is wonderful thing.
> 
> Not necessarily: if it's a command, you say you're going to loop. If
> it's just one more connection, you can miss the point. Hmm, in Basic
> you say FOR X=...NEXT X, in C you don't need to. Advanced. But then
> again, in C you have the block structure and indents to help you - and
> we all know you'll have to watch for blocks longer than you can see at
> once on the screen. (Some people put these /* End of X loop */ comments
> there just because of this).

So you're worried that one could look at a long looping rank and think
it isn't a loop, which leads to unanticipated errors? This could indeed
be a problem; but IMHO a view option showing loops (maybe connected to
the loop headcell feature?) would be better here.

Classical programming languages need loop constructs because there is no
way to order the commands in a loop: they are always in a stream, coming
from the parsed sourcecode character stream. A similar artifice is used
for function definitions/calls, for if-then-else blocks etc. In ZigZag,
we need to use construct structural artifices to have these other
things, too; but we can do loops directly from the structure. And we
should use this, IMO. Well, I suppose we don't need to agree on this;
Ted'll tell us what to do for the "director's cut," and in my
programming applitude, I will do what I see fit. (Although I appreciate
discussing this.) :)

- Benja