bogs wrote: ↑Sun Mar 21, 2021 11:26 am
...allows equivalence to sequential IFs in a more readable block...
See, now that I just don't get. How is 'if / then' any more or less readable than switch/case/{break | noBreak}.
I agree with all of the not-quoted, in that there is no immediate problem with implementation of desired logic. For that matter, we do not really need both
while and
until in Repeat loops, but it makes things more convenient in terms of thinking about loop structure. By the same token, switch/case can be a more readable structure, particularly because common formatting rules set out the block structure.
Here are two logically equivalent blocks, as formatted by LC:
Code: Select all
put "freddo" into arthur
if arthur is "martha" then get "whisky"
if arthur is "freddo" then get eat("chocolate")
put it into somewhereElse
Code: Select all
put "freddo" into arthur
switch arthur
case "martha"
get "whisky"
break
case "freddo"
get eat("chocolate")
end switch
put it into somewhereElse
The first one is shorter, has all of the same effects, but is less obviously a coherent code block (especially when extended into further conditionals, e.g. 5+ or 50+). The second is thus more readable. The practical effects of a nobreak statement, if any, are not yet considered. I am certain that they would not allow magical new logic. They may, however, allow existing logic in more readably coherent code blocks.
There is no way I am going to defend this option to the death.