Re: New switch/case idea

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

How about single colon for continue and double colon for break.

The single colon would fall through. When the parser encounters a double colon it would continue until it saw the next case keyword.

This would be easier to parse and eliminates a lot of typing and extra wording and keeps it simple in the Euphoria tradition.

Actually, the new proposed syntax does not use : at all, it uses then, to keep with Euphoria syntax:

switch X do 
    case 1 then 
        ? 1 
    case 2, 3, 4, "John" then 
        ? 2 
end switch 

Jeremy

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

Search



Quick Links

User menu

Not signed in.

Misc Menu