Re: New switch/case idea
- Posted by DanM Apr 04, 2009
- 1820 views
if the previous statement is not a looping construct, the "do" marks the begining of a non-looping block. Actually to be very consistent we should be using the syntax ...
if condition do block end if
Wait a minute ... Where did you see if condition do?
The standard Euphoria doesn't have that, it has then marker here, to in Russian mode. And it is very good. In C we have { for all at all markers of begining.
You misread what he said. He said that to be perfectly consistent, we'd have if-do blocks instead of if-then blocks. I think the usage of 'then' is largely historical, from BASIC dialects, and is pretty widely understood.
Do not explain me "what he said", please. I just can not believe that if-do is his own invention for future Euphoria, and reask him.
<snip>
Regards,
Igor Kachan
kinz@peterlink.ru
Igor,
The reason Matt is explaining what Derek said is because, I think, you are misunderstanding what Derek said in this instance. Derek is in no way saying that if-do is "his own invention for future Euphoria". He is not suggesting that if-do should replace if-then.
if-do is an hypothetical example that he did invent to acknowledge that if Euphoria were to strictly follow the idea he is presenting that "...the "do" marks the begining of a non-looping block", then, since an if-then statement is not a LOOPING block, it "should", technically, be if-do.
But since the if-then usage and meaning is historically very clear to most programmers, there would be no good reason to change it to if-do just to be consistent with the use of "do" to mark the beginning of a non-looping block.
Just trying to clarify what I think is a misunderstanding on your part, not trying to teach a sly bear how to catch a slippery fish.
Dan