BASIC regret – no early exiting AND/OR
Pages: 1 2
nemo (145) 2546 posts |
Bestest evs would be short-circuited binops… which could be && and || because why not. && is easier than || of course, because early failure is easier than early success (that is not intended to be a philosophical maxim).
Yeah, in this case. But I could contrive a three-part dependency and you’d have to add a predicated CONTINUE in there too. |
Steve Drain (222) 1620 posts |
For BBC BASIC you might have some problems with interpreting them and avoid corner coonditions, but not impossible I expect. Not possible with Basalt, but the
Why so? I found them equivalent, and the BASIC work-arounds are quite symmetric.
No need. BASIC does CONTINUE with an early ENDWHILE UNTIL0 or NEXT. |
nemo (145) 2546 posts |
No I was wrong.
UNTIL0 yes. The other two, no, not always. |
Steffen Huber (91) 1953 posts |
Since BASIC has AND and OR, it would be logical to use AND_THEN and OR_ELSE like DEC Pascal or AND THEN and OR ELSE like Ada. Introducing C-/Java-like operators in BASIC would be…somehow alien. |
nemo (145) 2546 posts |
Sadly ELSE has magical qualities and can’t be overloaded in this way. In fact it’s worse than that, you can’t even have byte value &8B in a string after an IF statement. :-( Little-known ever-present obscure bug #1. |
Steve Drain (222) 1620 posts |
But it has been documented as a WARNING in my BASIC StrongHelp manual for years.;-)
If you are going to the trouble of developing BASIC, then this bug could be dealt with at the same time. |
nemo (145) 2546 posts |
Says the guy who has clearly gone to a lot of trouble. Do you have a warning against |
Steve Drain (222) 1620 posts |
If you mean the danger of calling MOS routines in the address range &FFCE-&FFF7, then yes. But that is documented in the BASIC manual. |
Pages: 1 2