Re: OT: The REAL RIddle of DO LOOPS Solved
- From: "Richard Atkins" <richard.atkins@xxxxxxxxxxx>
- Date: 26 May 2006 04:26:22 -0700
By logical extension, if the initial value is GREATER than
the STOPPING value, the default step size should be -1,
to be consistent with the "+1" convention, in context.
[Not the] ... ARBITRARY convention adopted by the new
ANSI -- to the detriment of violating sound LOGIC and
consistency.
When encountering the instruction FOR X = A TO B where A > B then
surely the 'logical' and 'consistent' thing for a programming language
from the 60s would be to set X to A and then increment until the value
wraps round to B.
Facetiousness aside: When encountering ambiguity, rather than guess
what I meant using 'logical extension' (which in some contexts may not
be logical, depending on what A and B actually represent) I would
rather programming languages have simple, unconditional behaviours and
respond to ambiguity by throwing an error, requiring me to be more
explicit. After all the ambiguity may as easily have arisen from a
design or programming error.
In particular, since BASIC has an optional STEP statement that would
allow me to explicitely implement conditional 'reverse' stepping (e.g.
STEP SIGN(B-A)) then it shouldn't be guessing that this is what I
wanted even though I didn't ask for it. Anything less is sloppy
language design that encourages sloppy programming.
.
- Follow-Ups:
- Re: OT: The REAL RIddle of DO LOOPS Solved
- From: Reef Fish
- Re: OT: The REAL RIddle of DO LOOPS Solved
- From: Nigel
- Re: OT: The REAL RIddle of DO LOOPS Solved
- References:
- OT: The REAL RIddle of DO LOOPS Solved
- From: Reef Fish
- Re: OT: The REAL RIddle of DO LOOPS Solved
- From: Reef Fish
- Re: OT: The REAL RIddle of DO LOOPS Solved
- From: Lou Thraki
- Re: OT: The REAL RIddle of DO LOOPS Solved
- From: Reef Fish
- OT: The REAL RIddle of DO LOOPS Solved
- Prev by Date: Re: Hidden information question
- Next by Date: Re: Hidden information question
- Previous by thread: Re: OT: The REAL RIddle of DO LOOPS Solved
- Next by thread: Re: OT: The REAL RIddle of DO LOOPS Solved
- Index(es):
Relevant Pages
|