[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Map and filter without intermediate tables
- From: joao lobato <btnfdp.lobato@...>
- Date: Fri, 8 Jun 2012 12:22:25 +0100
On 6/8/12, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Fri, Jun 8, 2012 at 1:34 AM, Jay Carlson <nop@nop.com> wrote:
>> I think the aesthetic argument is that code should be written vertically,
>> not horizontally,
> [...]
> So I guess the point is that "expr:foo():bar():baz()" is not
> immediately recognized as "local e = expr; e:foo() e:bar() e:baz()"
> and we're back to the poor sod having to stop and examine things.
> [...]
>
I suppose that my argument is that in Java I would expect expr:foo()
to only change the state of expr (thus returning void) or don't change
its state and return something other than its internals that should be
passed to another object. In a functional language, where each
function is only defined by what goes in and what comes out, it makes
sense to return the same object modified.
In Lua, which is neither, I suppose I should not expect nothing in
particular - other than the Spanish Inquisition, just in case :-) .
- References:
- Map and filter without intermediate tables, Geoff Leyland
- Re: Map and filter without intermediate tables, joao lobato
- Re: Map and filter without intermediate tables, Geoff Leyland
- Re: Map and filter without intermediate tables, joao lobato
- Re: Map and filter without intermediate tables, Geoff Leyland
- Re: Map and filter without intermediate tables, steve donovan
- Re: Map and filter without intermediate tables, joao lobato
- Re: Map and filter without intermediate tables, steve donovan
- Re: Map and filter without intermediate tables, Jay Carlson
- Re: Map and filter without intermediate tables, steve donovan