lua-users home
lua-l archive

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


>From lua-l@tecgraf.puc-rio.br  Fri Jun 16 10:43:01 2000
>From: "Mauro Vezzosi"<mvezzosi@libero.it>
>
>a = { sin(1), cos(1) } gives "error: attempt to call a number value" on

This bug was reported here some weeks ago.
It has been fixed in 4.0 (beta), to be released "soon".

>2) The redefinition of the lua_userinit() as a macro works fine in the
>function call but not in the function definition:
>I solved it using locally the LUA_REENTRANT macro.

Yes, that's the way to do it. I'll change the src/lua/README.

>3) In src\lua\Readme is written to define "void lua_userinit (void)" 
>but it should be "void lua_userinit (lua_State *)".

Ditto.

>4) In manual.html is missing the description of the new read(N) feature.

This will be fixed.

>5) In the mailing list file ("Archive") there is an EOF at 2872679th
>character and some (MSDOS) editors or some programs which reads Archive 
>in text mode stops reading it early.

Oh, DOS :-(
Thanks, I'll fix it (the archive, not DOS :-).
There's also a ^X nearby...
It's a message from Steve Goodrich. Perhaps ^Z and ^X bracket some kind of
style change in an editor?

>6) I use luaM_malloc/free/realloc/new() because they are ready for use
>functions with error checking. I would like to have the macro for
>LUA_REENTRANT undefined as standard Lua like other auxiliary functions.

luaM_* are not auxiliary functions, but I'll discuss this with the rest
of the team.

>7) I think that the Lua 3.2 predefined _PROMPT variable was a good idea 
>but in Lua 4.0 it is removed.

You lost me here. _PROMPT is still there, in src/lua/lua.c.

>8) I prefer to use dynamic allocation memory instead of stack memory for
>large variables to reduce the fixed stack size (I can't allocated
>dynamically the stack):

You mention 3 char buffers and 1 FuncState.
The char buffers could be made smaller.
A local FuncState is good in the parser becasue if there's a parse error
then there's no need to free it: the longjmp will clean it, because it's in
the stack.

>9) I know that this is an old problem. I have added the possibility to 
>read the constant numbers with base from 2 to 26 by the compiler 
>instead of using the tonumber() function (i.e. 0b10011, 0X1F). I think 
>that it's not very difficult to implement and it not increase the 
>executable very much.

Right, it's not difficult to implement, but that does not mean that it should.
We're currently trying to simplify Lua, not add features.
So, I think using a function is the way to go here.
Try
	function X(s,b) return tonumber(s,b or 16) end
and write
	X"1FAB" or X("0101010",2)

Thanks for the comments.
--lhf