Is it necessary to have both "repeat with..." and
"repeat for..."?
Since the next word is either "x" or "each" it shouldn't
be too difficult to make them both "for", the usual
word in other languages.
Repeat with...Repeat for...
Moderator: Klaus
Repeat with...Repeat for...
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: Repeat with...Repeat for...
Yes
They do different things, both of which are useful - check out 'repeat' in the dictionary
Regards
Dave
They do different things, both of which are useful - check out 'repeat' in the dictionary
Regards
Dave
"...this is not the code you are looking for..."
Re: Repeat with...Repeat for...
"Repeat with", though slower than any other type, is utterly essential, since it manages a repeat index internally. All the others either test a condition, contain no index or other constrant at all, or churn through successive chunks of a container.
One might make a case that "repeat while" and "repeat until" are different aspects of the same conceptual process, but each is useful in its own right if for no other reason than either construction might make more sense depending on how one sets up the loop.
Craig Newman
One might make a case that "repeat while" and "repeat until" are different aspects of the same conceptual process, but each is useful in its own right if for no other reason than either construction might make more sense depending on how one sets up the loop.
Craig Newman
Re: Repeat with...Repeat for...
Sometimes I miss the Pascal way of handling Repeat and While, but I do like the different flavors we get with LC, especially the way that repeat for is optimized to increase speed.