[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight syntax: a dissident view
- From: Alex Bradbury <asb@...>
- Date: Sat, 27 Nov 2010 10:12:53 +0000
2010/11/26 Pierre-Yves Gérardy <pygy79@gmail.com>:
> On Fri, Nov 26, 2010 at 23:49, Doug Lua <douglua@dkrogers.com> wrote:
>> \x,y,z(x*y+z) --> function(x,y,z) return x*y+z end
>>
>> It's concise and seems to have the fewest (zero?) ambiguities.
>
> It doesn't support statements. Just one expression list to be
> returned. It's useless if you want to use it for delayed execution of
> code blocks.
See Tony Finch's modified version of this syntax. He's also got the
patch to modify the Lua and LuaJIT 2 parsers on github:
http://article.gmane.org/gmane.comp.lang.lua.general/70923
To quote from his message:
function ::= function `(´ [parlist] `)´ <block> end
| `\´ [parlist] `(´ [explist] `)´
| `\´ [parlist] <funbody>
funbody ::= <function> | <dostat> | <ifstat> | <loopstat>
which would allow
each = \ f \ t for k,v in pairs(t) do
f(k,v)
end
Alex
- 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, Doug Lua
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy