lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I didn't do much testing; I tried to keep it simple and go for correctness
instead of speed. If you find any bugs, please let me know.

Ok, if we find something wrong I'll let you know ! :) (but I doubt it...)
Note that you do not need a full-blown sprintf. The only place in the core
that uses sprintf is this:
lvm.c:#define lua_number2str(s,n)     sprintf((s), LUA_NUMBER_FMT, (n))

string.format uses it too... (lstrlib.c). I don't think a Lua5 port would be very useful without the string lib, and a complete sprintf/vsprintf function is useful in some cases. :) PalmOS native StrVsPrintF function is very limited.
So, you only need it to convert numbers to strings. If your port does not
use floating-point numbers, this is really easy...

Hehehe, we're using doubles there, as Lua Numbers. And we've created a strtod and dtostr functions as well... So number conversion are working right, now. :)
The functions that the core uses but are not in my implementation are:
sprintf, strtod, setjmp, longjmp, exit.

Since the port is working on Codewarrior now, we already has implemented strtod, sprintf (not MIT) and exit.
setjmp and longjmp depend on the compiler.
Codewarrior handles that for us...
Good luck.
Thank's ! We'll need it. :)
J. Machado
machado@palmcon.com.br
Palmcon Consultoria (www.palmcon.com.br)
+55 21 9302-2794