lua-users home
lua-l archive

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


On Wed, 14 Jan 2015 13:32:59 +0000
James Urso <JUrso@iwakiamerica.com> wrote:

> > > >On Wed, 14 Jan 2015 15:03:49 +0200
> > > >Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 
> > > 2015-01-14 14:51 GMT+02:00 Timm S. Mueller <tmueller@schulze-mueller.de>:
> > > 
> > > > a serialization and deserialization library. Requirements:
> > > >
> > > > - must cover Lua 5.1, 5.2, 5.3 and LuaJIT
> > > 
> > > You mean, Lua 5.3's string.pack/unpack would be taboo?
> 
> > No. What I mean is that it must cover Lua 5.1, 5.2, 5.3 and LuaJIT.
> 
> > - Timm
> 
> We used Luiz' lpack library http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/#lpack for a Lua 5.1 project and when I recently upgraded the project to Lua 5.3, it continued to work fine with no modifications.  I haven't used LuaJIT, so I can't speak for that.  
> 
> Based upon the pack / unpack functionality in Lua 5.3, I'm guessing that it is based upon Luiz' original library.

Thank you, but this one doesn't seem to handle tables:

$ make
a=bpack({hello="world"},"Ab8","\027Lua",5*16+1,0,1,4,4,4,8,0)
test.lua:11: bad argument #1 to 'bpack' (string expected, got table)

Sorry, I did not mention tables (and recursion) exeplicitely, although
I meant to imply this by cyclic references.

Also I would have problems with reliance on binary data representation
between different Lua versions and architectures. This doesn't rule out
a solution entirely for now, but in the medium to long term.

Addendum to the requirements list:
- Must handle tables recursively

- Timm

-- 
Timm S. Mueller <tmueller@schulze-mueller.de>
Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. +49 30 85610000, http://www.schulze-mueller.de/