[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [ANN] lua_bufflib
- From: Choonster TheMage <choonster.2010@...>
- Date: Thu, 9 May 2013 13:59:40 +1000
On Thu, May 9, 2013 at 6:28 AM, Egil Hjelmeland
> 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?
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.