JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Wed Oct 18, 2006 9:43 pm Post subject: October 18th -- Characters, fixed indexing, fixed multi-ret |
|
|
Damn, all these programming projects for school really eat into your programming projects for fun..!
Anyway, I changed indexing codegen. I hope that it works properly in all cases now. I got so fed up with it that I just said "forget it" and made some kludges, and now it all works nicely. It's awful, I know. But I don't want to deal with indexing. Ever. Again.
New: a new 'character' datatype, for various reasons. The integer/character duality of the int type was just too ugly in some cases. Having a proper character type makes things like:
Code: | local s = 'a' ~ 'b'; // yields string "ab"
local str = 'c' ~ "at"; // yields "cat" |
Possible, as well as making some library functions a lot more obvious what they expect.
You can also still switch on characters, so
Code: | switch("hello"[4])
{
case 'o': ...
} |
Works fine. Also notice the indexing of a string -- right now it's provided through an opIndex in the string type metatable, but I think I'll implement it natively.
Lastly, there was a bug with multiple returns where they just didn't work. So if you returned the value of a function, the caller would get nothing back. Now they work.
Oh and I started the math standard lib, but it's just got rand() right now.
I'm getting really excited about how MiniD is starting to look and act. It's starting to feel more like my own language than a derivative of Lua.
[Edit]Oh, there's also a little makefile in the repo which should hopefully be a little more enlightening than the batch file for how to build test.exe. I have to port it to *nix, but at least it's there. It's not as makefile-y as I'd like it though, because due to Bug 282, the compilation has to be done in a very specific way to avoid DMD throwing really stupid errors. |
|