[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Tuples and other constant values
- From: Tim Hill <drtimhill@...>
- Date: Wed, 8 Jul 2015 14:58:33 -0700
> On Jul 8, 2015, at 2:36 PM, Philipp Janda <siffiejoe@gmx.net> wrote:
>
> Have you ever wondered why strings aren't implemented as userdata (given Lua's minimalistic nature)? Both are essentially sequences of bytes, after all.
>
>>
>> -Andrew
>
> Philipp
>
Different visibility. A userdata cannot be mutated by Lua code, only C code (the exception being it can be GCed, but even then C code can be informed of this via __gc). This allows a C library to offload storage of state to Lua but still be assured coherence of that state.
—Tim
- References:
- Tuples and other constant values, Dirk Laurie
- Re: Tuples and other constant values, Cosmin Apreutesei
- Re: Tuples and other constant values, Coda Highland
- Re: Tuples and other constant values, Cosmin Apreutesei
- Re: Tuples and other constant values, Tim Hill
- Re: Tuples and other constant values, Coda Highland
- Re: Tuples and other constant values, Tim Hill
- Re: Tuples and other constant values, Jay Carlson
- Re: Tuples and other constant values, Daurnimator
- Re: Tuples and other constant values, Tim Hill
- Re: Tuples and other constant values, Dirk Laurie
- Re: Tuples and other constant values, Andrew Starks
- Re: Tuples and other constant values, Philipp Janda