lua-users home
lua-l archive

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


Hi,

I tested the string.pack() and string.unpack in Lua 5.2.3 (copied them to lstrlib.c), which works fine.

And of course :-) some questions came up:

1) why is in string.pack the default length for c (simple string) 1, and not the string's length? pack() throws an error if the string's length does not match the coded length, but there is no method to encode the length as a variable

2) why is there no way to put literal characters into the pack()ed string?

3) the description for the 'X' specifier
"an empty item that aligns according to option op (which is otherwise ignored)"
was not clear to me at first. Possibly
"align like but ignore the format option op"
would be faster to grab

--
Oliver