1. Re: 3.0 feature request: foreach

On 13 Jul 2005, at 2:24, Al Getz wrote:

<huge snippage>

> My vote goes for Case/Switch, if anything.
> 
> There's another argument for case/switch that sets it apart from
> other 'nested' type tests, and that is that there is ideally only
> *ONE* test performed and then a jump.  That single test resolves
> into an integer which is then used to determine the jump.
> Currently the only way to do this is to make your own case/switch
> syntax using routine id's and a whole set of functions.


<pseudo ooeucode>

function demo(sequence case)

goto case
return "0" -- :"case" target not found!

:"1"
-- code
goto eofunct

:"blah"
-- code
return "something"

:"transformer"
:"bot"
:"minsky"
:"robot"
:"borg"
:"Number 5"  
-- try doing 6 targets at once like that with case!
return "it's alive!"

:eofunct
-- more code if you like

return ""

end function

</pseudo ooeucode>

So we CAN do this NOW.

Kat

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu