Re: Py Update
- Posted by "Cuny, David at DSS" <David.Cuny at DSS.CA.GOV> Oct 20, 2000
- 623 views
Kat wrote: >> Maybe I'll go to bytecode. > > If you can, then "case - end case" would be > trivial and faster too, yeas? No, it would be 90% the same as the If code. The real work would be at the grammar level, so that stuff like this would parse properly: case is > 23 or is < 22: case 1,2,3: case 90 to 100: Bleah. I don't really think that there's *that* much need for a Case statement, though. Basically, you can just write: object is is = <expr> if is = 12 then ... elsif is = 33 then ... end if and get the same sort of thing. > exit(for) > exit(if) > exit(procedure) > exit(function) > exit(repeat) If you had a goto, there really wouldn't be any need for all these exits anyway. I suspect that I'm not likely to make the jump to 'flat' opcodes, since I suspect that the resulting code would actually run a bit slower - there would be more granularity to the instructions, and less of a 1:1 mapping to Euphoria. One thing I *could* do is add a pop() statement, that would 'pop' out of 'n' levels of instructions. The problem here is that it's *way* too easy to mess up with something like that. Add an additional test, and you've changed the nesting count. Blooey goes the code. Thanks! -- David Cuny