[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: In Lua 5.3 -- why were string.[un]pack(int|float)() added?
- From: Sean Conner <sean@...>
- Date: Sat, 19 Apr 2014 16:49:48 -0400
It was thus said that the Great Coroutines once stated:
> On Sat, Apr 19, 2014 at 1:18 PM, Michal Kottman
> <michal.kottman@gmail.com> wrote:
>
> > Bitwise operators + string.[un]pack(int|float) is a very powerful combination.
>
> That does make me hopeful :-) The only other thing I would then wish
> for is a debug.dump() that acts like string.dump() but also allows for
> stringifying userdata.
You could always code it up and hope it gets adopted.
But I don't see it being all that viable for userdata. About the best you
can do is convert userdata into hex, base64 [1] or ascii85 [2] and hope
there aren't any pointers to other data. Generalized, it's impossible, but
you could get a (somewhat) useful limited implementation.
-spc (So how do you transfer a string.dump()ed function from x86 to ARM?)
[1] http://en.wikipedia.org/wiki/Base64
I like that there are 13 different "standard" base64 encodings.
[2] http://en.wikipedia.org/wiki/Ascii85