JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Wed Aug 16, 2006 10:23 pm Post subject: August 16th - an EXCEPTIONal day |
|
|
I just had to make that pun. Sorry.
I DID EXCEPTIONS AND YOU CAN THROW THEM FROM NATIVE OR SCRIPT CODE AND THEY CAN BE CAUGHT FROM NATIVE OR SCRIPT CODE OMG OMG OMG
I think it's pretty cool. As long as you follow the rules (your exception must be or be derived from MDException, and must also hold an MDValue with the MiniD compatible exception object), it's wonderfully seamless.
I'm so happy I could.. spit. Or something like that. And all the exception code amounted to very little indeed - ~40 lines for all 6 exception opcodes, ~30 lines for the stack unwinding, and.. some small changes to the MDException hierarchy (now it's just MDException, and from it, MDCompileException). That's it.
Also did some cool stuff - I made an MDTable ctor for native code, so you can write table constructors almost as easily as in MiniD code. Like so;
Code: | MDClosure func = ...;
MDTable tab = new MDTable(
"foo", 5,
"bar", 7.6,
"baz", func); |
So the params are interpreted as pairs, with the first being the key and the second being the value. I plan on doing something similar for MDArrays.
This is so awesome. |
|