Re: Py Update

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

On 20 Oct 2000, at 10:12, David Cuny wrote:

> Kat wrote:
>
> > Does it have a "goto"? smile
>
> I *knew* you would ask that!
>
> No, the issue is that I've implemented that internal representation
> (including nested structures) using nested sequences. If I had used
> bytecodes instead, it would have been trivial.
>
> Maybe I'll go to bytecode.

If you can, then "case - end case" would be trivial and faster too, yeas?

case WonderWhatThisIs :
 "hello" : procedure greet
 iswm(*thanks*) : procedure thanks
 -- 5000 other tests
end case

after each test is an implied goto(end case), so the other 5000 tests need not
be done.
This would replace the big

if ( ) -- code
elsif ( ) -- code
elsif ( ) -- code
elsif ( ) -- code
-- 50 more elsif()
end if

stack i have in one app now. But the current "if" stack does work fine now.

"exit" would be easier to do also, you'd have all the exits people have asked
for,

exit(for)
exit(if)
exit(procedure)
exit(function)
exit(repeat)

all would be a *local* goto in disguise. I said *local* to procedure or
function, jumps
outside local should be illegal, imho, just 'cause of complexity.

Kat,
just thinking out loud here atm.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu