[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Questions about string.pack() and string.unpack()
- From: Oliver Kroth <oliver.kroth@...>
- Date: Thu, 27 Nov 2014 13:44:34 +0100
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