[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: blocks in Lua (was Re: [PROPOSAL] [PATCH] simple method call)
- From: Nagaev Boris <bnagaev@...>
- Date: Tue, 16 Jun 2015 14:41:05 +0000
On Mon, Jun 15, 2015 at 9:18 PM, Aapo Talvensaari
<aapo.talvensaari@gmail.com> wrote:
>> On 2015-06-12, at 6:46 PM, Rena <hyperhacker@gmail.com> wrote:
>> > command = input:urldecode():lower():trim():split(' ')
>
>
> You can do this:
> command = filter.urldecode.lower.trim.split(' ')(input)
>
> One of the nice things about this is that the filter chain can be cached
> easily:
>
> f = filter.urldecode.lower.trim.split(' ')
> command = f(input)
> command2 = f(input2)
I have implemented this [1]. The only difference is that methods with
parameters are applied with colon not with dot. If a method with
parameters was applied with dot, then it would be indistinguishable
from the application of the pipe itself.
[1] https://gist.github.com/starius/d72f5b2ddc5fd4bf2460
--
Best regards,
Boris Nagaev
- References:
- [PROPOSAL] [PATCH] simple method call, Rodrigo Azevedo
- Re: [PROPOSAL] [PATCH] simple method call, Rodrigo Azevedo
- Re: [PROPOSAL] [PATCH] simple method call, Soni L.
- Re: [PROPOSAL] [PATCH] simple method call, Thomas Jericke
- Re: [PROPOSAL] [PATCH] simple method call, Soni L.
- Re: [PROPOSAL] [PATCH] simple method call, Thomas Jericke
- Re: [PROPOSAL] [PATCH] simple method call, steve donovan
- Re: [PROPOSAL] [PATCH] simple method call, Brigham Toskin
- Re: [PROPOSAL] [PATCH] simple method call, Rena
- blocks in Lua (was Re: [PROPOSAL] [PATCH] simple method call), Jay Carlson
- Re: blocks in Lua (was Re: [PROPOSAL] [PATCH] simple method call), Aapo Talvensaari