[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available
- From: Pierre-Yves Gérardy <pygy79@...>
- Date: Tue, 23 Nov 2010 18:33:06 +0100
On Tuesday, November 23, 2010, Axel Kittenberger <axkibe@gmail.com> wrote:
> Optically I like pipes too, since they also remind me of their use in
> the shell to "tie things together". Their main problem tough is they
> cannot nest, as the begin and end token is identical. One could say,
> if you want nesting use full function syntax please, but well maybe
> someone has a problem with it not working.
>
> | a, b => | x => x* x * x | (a+b) |
>
> -> supposedly a real challenge for the parser.
You're of course right. I had taken this fact into account while
writing the previous post, but I removed it while refactoring, and
forgot about it afterwards.
| args ( expression )
| args [ statements => expression ]
Variations of the above expressions are the only legal possibilities
with one character tokens.
@| args => expression |
@| args : statements => expression |
is also valid at the expense of an added symbol. A function of he
second kind with no arguments becomes with the first or second syntax:
| [ statements ]
@|: statements |
Which isn't too bad.
Kind regards,
-- Pierre-Yves
- References:
- [ANN] Lua 5.2.0 (alpha-rc2) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Petite Abeille
- Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Petite Abeille
- Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Pierre-Yves Gérardy
- Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Mark Hamburg
- Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, steve donovan
- Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Mark Hamburg
- Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Pierre-Yves Gérardy
- Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available, Axel Kittenberger