lua-users home
lua-l archive

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


On Thu, May 9, 2013 at 6:28 AM, Egil Hjelmeland
<privat@egil-hjelmeland.no> wrote:
> On 08. mai 2013 21:28, Choonster TheMage wrote:
>>
>> lua_bufflib is a library for string buffers in Lua.
>>
>> lua_bufflib's homepage is athttp://choonster.github.io/lua_bufflib/
>
> I just took a quick look at the documentation.  Very good by
> Lua-addon-standards, I think. I just missed a statement about the purpose of
> the thing. I suppose the idea is that it has better performance than native
> Lua strings when it comes to operations on long strings?
>
> Egil
>
>

Pretty much. It's just supposed to be more efficient than
concatenating a whole lot of strings and slightly more user-friendly
than using an array of strings with table.concat.

I don't have any grand purpose for this library, I just felt like
writing something to provide luaL_Buffer operations to Lua. I was
originally planning to make it a wrapper around the existing
luaL_Buffer code, but trying to find the char array userdata on the
stack and moving it to the registry and back for each function was a
pain; so I decided to write a new Buffer "class" based on luaL_Buffer
that automatically stores its contents in the registry.