[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Some crazy proposals :-)
- From: Daurnimator <quae@...>
- Date: Fri, 10 Jul 2015 11:16:29 +1000
On 10 July 2015 at 10:50, Egor Skriptunoff <email@example.com> wrote:
> On Fri, Jul 10, 2015 at 2:38 AM, Coda Highland <firstname.lastname@example.org> wrote:
>> On Thu, Jul 9, 2015 at 4:30 PM, slayer beast <email@example.com>
>> > I would love to have a syntax like this:
>> > some_table['a_name', 'another'] = a, b
>> Sadly this conflicts with one of the suggestions for the tuple-keyed
>> table proposal. We can't have them both.
> This is tuple-keyed assignment:
> some_table['a_name', 'another'] = c
> And this is two distinct assignments:
> some_table[ ('a_name', 'another') ] = a, b
> Old good idea: parentheses mean converting a tuple to a single value.
Neither translate well to the __newindex metamethod.
__newindex = function(t, k, ...)
Is the ... extra keys follows by a value, or multiple values
I'd prefer that we limited it to a single value.
This way it isn't ambiguous; but it's still awkward (optional middle