[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Requesting Suggestions for intermediate/advanced book on Lua
- From: Justin Cormack <justin@...>
- Date: Mon, 7 Oct 2013 09:44:49 +0100
On Mon, Oct 7, 2013 at 5:57 AM, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Sun, Oct 6, 2013 at 10:23 PM, Jay Glascoe <jay.glascoe@gmail.com> wrote:
>> I think normally I would do something like "map(theFunction, theList)"
>> whereas Underscore has "map(theList, theFunction)". What's cool about that,
>> in Lua, is if your your list (table) is an object with "map" to be found
>> somewhere in it's metatable's index, you can do "myObject:map(theFunction)"
>
> Yep, I went through that as well with Penlight - so it works both
> ways: there is tablex.imap (fn,t) (where t is a array-like table) but
> the List class has a map method: ls:map(fn).
That seems a reasonable compromise. The f in front ordering is for
ease of currying. Clearly this shows the incompatibility between
functional and object, wanting the arguments the other way round...
Justin
- References:
- Requesting Suggestions for intermediate/advanced book on Lua, Jay Glascoe
- RE: Requesting Suggestions for intermediate/advanced book on Lua, Thijs Schreijer
- Re: Requesting Suggestions for intermediate/advanced book on Lua, steve donovan
- Re: Requesting Suggestions for intermediate/advanced book on Lua, Jay Glascoe
- Re: Requesting Suggestions for intermediate/advanced book on Lua, Steven Johnson
- Re: Requesting Suggestions for intermediate/advanced book on Lua, Steve Litt
- Re: Requesting Suggestions for intermediate/advanced book on Lua, Jay Glascoe
- Re: Requesting Suggestions for intermediate/advanced book on Lua, H. Conrad Cunningham
- Re: Requesting Suggestions for intermediate/advanced book on Lua, Jay Glascoe
- Re: Requesting Suggestions for intermediate/advanced book on Lua, H. Conrad Cunningham
- Re: Requesting Suggestions for intermediate/advanced book on Lua, Jay Glascoe
- Re: Requesting Suggestions for intermediate/advanced book on Lua, steve donovan