[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight syntax: a dissident view
- From: phlnc8 <phlnc8@...>
- Date: Fri, 26 Nov 2010 13:14:36 -0500
On Fri, Nov 26, 2010 at 1:02 PM, Erik Lindroos <gliptic@gmail.com> wrote:
> On Fri, Nov 26, 2010 at 6:54 PM, phlnc8 <phlnc8@gmail.com> wrote:
>>
>> How about
>> [ x : x > 3 ]
>> [ x, y : x+y, compute_something_else(x,y) ]
>>
>> Syntax (reusing Lua syntax terms):
>> '[' parlist ':' explist ']'
>
> It's hard to parse. For example:
> { [ x : x > 3 ] = 0 }
> The meaning of "[ x : x > 3 ]" cannot be determined until the '='. It needs
> arbitrarily large lookahead.
You're right! ':' cannot be used to separate arglist and explist ...
It should be replaced with, eg. '|':
[ x | x > 3 ]
[ x, y | x+y, compute_something_else(x,y) ]
Syntax (reusing Lua syntax terms):
'[' parlist '|' explist ']'
Phil
- References:
- Re: Re: Re: Lightweight syntax: a dissident view, Gunnar Zötl
- Re: Re: Re: Lightweight syntax: a dissident view, Luis Carvalho
- Re: Re: Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Re: Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Re: Re: Lightweight syntax: a dissident view, Roberto Ierusalimschy
- Re: Re: Re: Lightweight syntax: a dissident view, Mateusz Czaplinski
- Re: Re: Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Lightweight syntax: a dissident view, Philippe Lhoste
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Mark Hamburg
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Lightweight syntax: a dissident view, steve donovan
- Re: Lightweight syntax: a dissident view, phlnc8
- Re: Lightweight syntax: a dissident view, Erik Lindroos