mascarenhas/alien — pull request #31 by rrthomas (2012-09-24 22:29:48+00:00)
Title: Improve implementation of strlen & size of buffer

This series of commits renames buffer's "size" field to a __len metamethod for simplicity of use, renames its "len" method to "strlen" for clarity, and bumps the version to 0.7.0 (because the change is backwards incompatible).

Ideally, arrays would also have a __len metamethod, but this is not possible in Lua 5.1, where tables can't have a __len metamethod; I've already put in a FIXME to change this when Lua 5.1 support is dropped.

This set of changes enables use of raw memory buffers with the upcoming lrexlib 2.7.