Re: New switch/case idea
- Posted by jimcbrown (admin) Apr 06, 2009
- 1721 views
My idea was and is simple.
Agreed.
And Russian version of 'then' keyword, 'to', is good in "if...end if" construct only. It probably will require new keywords for using in other constructs.
Ugh! That could be an issue. Even if we can get english eu 4.0 to move to switch..on or some other syntax, case..then will probably be kept. (It makes perfect sense as an english speaker.)
I'm not sure about that 'switch ... on' for BEu anymore, sorry.
switch...on only makes sense with case...then.
First of all, to give some concrete try to your too elastic suggestion "switch ... on" for Bilingual Euphoria - BEu for short - http://www.youtube.com/watch?v=L_L5qaen3Zg
I don't like watching youtube.
If you read my previous posts on this subject, there are some suggestions from BEu side to English syntax.
switch_on X case a ?1 case b ?2 else ?3 end switch_on perekluchatt_po X -- literal translation - from railway, electric circuits etc areas kogda a ?1 -- 'when', literal translation - v_sluchae kogda b ?2 -- 'when', maybe, just 'if' is good here??? inache ?3 -- literal translation stop perekluchatt_po
The new example above looks good for BEu. Without 'switch_' part, it looks more compactly.
This is very similar to Yuri's proposed optional then-do:
if a ?2 else ?3 end if while c ? 1 end while
Which was emphatically rejected on EUforum. :/
So, let's think, guys...
Code of BEu, saved in English mode, seems to work on 4.0, I'll try it later on.
My vegetable garden waits me already, sorry.
Regards,
Igor Kachan
kinz@peterlink.ru
The underlying guideline for Euphoria, even EU 4.0, is that syntax must as closely as possible match English. The syntax sugar exists to make it easier for native English speakers to understand and pick up faster.
Applying that guideline for Russian, we can see that the syntax of Russian Euphoria must as closely as possible match Russian. It must make it easier for native Russian speakers to understand and pick up fastly.
Since a lot of the new 4.0 syntax is decidedly ugly to translate to Russian, the Russian version should break away from the English syntax when necessary in favor of forms that are more easily understood in Russian.
Therefore I really like this BEu idea. Having a separate parser for each language, so the syntax matches the native grammar best.