lua-users home
lua-l archive

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


It was thus said that the Great Jim once stated:
> On 5/16/19, Sean Conner <sean@conman.org> wrote:
> >> I still fail to wee why you need LUA_BUFFERSIZE. Why not BUFSIZ?
> >  1) Why have LUA_BUFFERSIZE when BUFSIZ exists?
> >  2) I still need to use C to know what the value is.  It seems like
> > overkill, and Lua already wraps several standard C functions,
> > so why not a constant ?
> 
> maybe he is reluctant to add it since it would not be a constant
> from the Lua side ?

  I'm not sure I follow.  BUFSIZ is defined by ANSI, and is a part of C89
(which is what Lua expects), C99, C11, etc.  LUA_BUFFERSIZE is defined by
Lua, so by definition, it exists there.  If you mean it can be changed by
the user in Lua, there's already one "constant" defined in Lua---"_VERSION",
a string representing the current Lua version.

> just add and export a C function along this lines to your package:

  I'm relunctant to add a C function *just for a constant*.  On Linux, the
minimum runtime size of a C-based module is 8K.  While machines today come
with gigabytes of RAM, it still bothers me to waste 8K for what is, at most,
an 8-byte constant.  Adding that function to another module is just pushing
the problem around.

  Given Roberto's latest reply, I'm going to just accept that this won't
happen any time soon.  Ah well ... 

  -spc