[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A proposal for the confusing pseudo table ≈ array concept
- From: Coda Highland <chighland@...>
- Date: Fri, 19 Jan 2018 23:04:03 -0600
On Fri, Jan 19, 2018 at 10:37 PM, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Elias Hogstvedt once stated:
>> I'm also wondering if for instance the introduction
>> of [] as a constructor would cause issues with other syntax (backwards
>> compatibility aside) or if these changes could make the C implementation
>> more difficult.
>
> I wouldn't mind this change---it would signal intent better in my opinion.
>
> -spc
>
It would introduce a syntactic inconsistency. x"1" and x{1} are both
unambiguously function calls, but x[1] is a table lookup, and x[1,2]
is a syntax error.
If you want to tag your constructor syntax, consider:
def list(t): return t
x = list{1, 2, 3}
/s/ Adam