suggested improvements to D
Warren D Smith
wds at math.temple.edu
Tue Jan 9 16:47:04 PST 2007
>> So your suggestion for this syntax is a good one:
>> bod: { // labeled compound statement
>> if(cond) break bod;
>> }
>Wrong. The keyword "break" only became a synonym for "goto"; the
>inherent shortcomings of goto's are not solved this way. (Proof
>left to the reader.)
--No, Mr. Anonymous - you're completely wrong.
Gotos can spaghetti, form arbitrary directed network.
Breaks out of blocks, can only get you out
of a block, i.e. moving up in the inclusion hierarchy -
can never go in, i.e. never down in the hierarchy.
I would, however, say that the bod: { ... }
syntax is psychologically annoying
and I might prefer bod: block{ ... }
or something.
wds
More information about the Digitalmars-d
mailing list