Re: The fate of Euphoria
- Posted by Tommy Carlier <tommy.carlier at telenet.be> Nov 09, 2004
- 548 views
Patrick Barnes wrote: > It doesn't exit out of the switch statement until you call break. If > switch was implemented in Euphoria, I think it would have to do things > this way, as C/C++ and Java both do things like this, and most > programmers use one of the three languages. I don't think that's a good idea. C# (newer than Java) gives a compile-time error when trying to use a 'case'-statement without a 'break'. Fall-through isn't supported BECAUSE it caused too many errors. You can do this: switch(x) { case 1: case 2: case 3: Console.WriteLine("1, 2 or 3"); break; case 4: case 5: Console.WriteLine("4 or 5"); break; } But if you leave out the 'break', you won't be able to compile. Fall-through causes errors, when you forget to 'break' at the right place. -- Recycle your pets. tommy online: http://users.telenet.be/tommycarlier tommy.blog: http://tommycarlier.blogspot.com