lua-users home
lua-l archive

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

On Fri, Oct 2, 2009 at 7:35 AM, steve donovan wrote:
> 2) The contents of the math table are all made global (there is in
> fact no 'math' table anymore). OK, I can see the temptation, but most
> Lua users are now used to bringing in math functions they need from
> math. This will also bite you if you decide to override functions like
> exp() to work on vectors/matrices. (A fast map function would be
> useful, otherwise)

If this is done, I request moving it out of the Lua patch and into the
gsl-shell.c so that gsl-shell can be deployed on a vanilla
LNUM-patched Lua (which LuaDist now supports).  Basically, you may do

  for k,v in pairs(math) do _G[k] = v end

gsl-shell.c could in fact be written entirely as a shell script
wrapper around Lua.

Another request: have gsl-shell load igsl.lua via require rather than
via luaL_loadfile.  Currently, igsl.lua only gets loaded if it exists
in the current directory.

> 4) Matrices are indexed beginning at zero, which was a little suprise!
>  I know there are fierce wars about this, but having two conventions
> hanging around is not good.

LuaMatrix [1] in comparison uses 1-indexing, but a major reason for
this is that it implements matrices as Lua tables.  Last time I
checked, Mathcad by default 0-indexes (though it can be changed),
while Matlab, Maple, and Mathematica 1-index.  Regardless, the
gsl-shell behavior here probably will be determined by GSL.