[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: [ANN] lua_bufflib 0.2
- From: Choonster TheMage <choonster.2010@...>
- Date: Sun, 19 May 2013 05:53:18 +1000
lua_bufflib is a library for string buffers in Lua.
lua_bufflib lives on GitHub, with documentation at . It can be
installed with `luarocks install lua_bufflib` (it may take some time
before this version is uploaded to the rocks server).
Version 0.2 adds support for calling string methods on Buffers by
prefixing the name with "s_". For example, `bufflib.s_gsub(buff, ...)`
and `buff:s_gsub(...)` are both equivalent to `str:gsub(...)` (where
`buff` is a Buffer and `str` is the Buffer's contents as a string).
All functions from the global "string" table can be called like this,
not just the ones defined by the string library.
Note that the library makes no attempt to determine whether or not the
string function should even be called with a string as the first
argument; so `buff:s_dump()` can be called, but it will probably throw
an error when calling `string.dump` with a single string argument.
I've attached the rockspec, which can be used to install the new
version before it's uploaded to the rocks server.
Description: Binary data