Re: New Switch Idea

new topic     » goto parent     » topic index » view thread      » older message » newer message
Critic said...

My proposal:

select value do 
  case 1, 2, 3, 5..78: doA() 
  case 6, 99: doB() 
  else doC() 
end select 
 
switch value do 
  case 1, 2, 3, 5..78: doA() 
  case 6, 99: doB() 
  else doC() 
end switch 

The only difference between "switch" and "select" is that "switch" falls through, "select" does not. To avoid a fallthrough inside a "switch" a "break" statement could be allowed. Personally, I would omit "switch" completely as it is not often needed and confusing, especially since EU also targets hobby programmers. But I included it in my proposal because others want the feature.

We decided on the dev list against this because of the very close similarities of switch/selects operations. Further, we think it's a good service to educate the programmer on fallthru and without fallthru as it will help them quite a bit when using other languages as well. However, thank you for your suggestion! This suggestion was explained well and not criticizing anyone or anything. This was what is helpful. Thanks!

Also, EU's target is no longer hobby programmers. EU is a general purpose programming language suitable for a wide variety of tasks. There are commercial applications written in Euphoria and commercial quality apps. Many of us also use Euphoria in our work place for mission critical tasks.

Jeremy

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu