[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Feature request: userdata slice
- From: Dirk Laurie <dirk.laurie@...>
- Date: Sat, 22 Aug 2015 07:48:27 +0200
2015-08-21 22:17 GMT+02:00 Tim Hill <drtimhill@gmail.com>:
>
>> On Aug 20, 2015, at 11:43 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>>
>>
>> The possibilities are legion!
>>
>
> Sadly so are the possibilities for abuse…
>
> a, b = get_two_integers()
> x, y = 1, 1
>
> print(a, b)
> -> 1 1
>
> print(x, y)
> -> 1 1
>
> print(x+y, a+b)
> -> 2 “Elephant”
One can do that easily with current Lua, by the simple expedient
of returning (despite the name) tables. If what is returned are really
integers as promised, no amount of individual metatable tinkering
will coax Lua into checking for the existence of __plus.
- References:
- Re: Feature request: userdata slice, 云风 Cloud Wu
- Re: Feature request: userdata slice, Tim Hill
- Re: Feature request: userdata slice, Philipp Janda
- Re: Feature request: userdata slice, 云风 Cloud Wu
- Re: Feature request: userdata slice, Dirk Laurie
- Re: Feature request: userdata slice, 云风 Cloud Wu
- Re: Feature request: userdata slice, Dirk Laurie
- Re: Feature request: userdata slice, Dirk Laurie
- Re: Feature request: userdata slice, Tim Hill
- Re: Feature request: userdata slice, William Ahern
- Re: Feature request: userdata slice, Roberto Ierusalimschy
- Re: Feature request: userdata slice, Dirk Laurie
- Re: Feature request: userdata slice, Tim Hill