[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Penlight Libraries, First release
- From: David Manura <dm.lua@...>
- Date: Wed, 13 May 2009 23:56:45 -0400
On Wed, May 13, 2009 at 9:28 AM, steve donovan wrote:
> On Wed, May 13, 2009 at 3:16 PM, David Manura wrote:
>> I mean that the List
>> operation t:map() does not modify t but rather returns a new object.
>> This differs from t:reverse(), which modifies t in-place and returns
>> itself.
I don't really like the complicating DWIM stuff in List:map (i.e.
is_type(arg1,List)):
function List:map (fun,arg1,...)
local res
if is_type(arg1,List) then
res = map2(fun,self,arg1,...)
else
res = imap(fun,self,arg1,...)
end
return setmetatable(res,List)
end
e.g. what if someone really wanted to pass a list as arg1 and have it
operated with imap?
- References:
- Re: [ANN] Penlight Libraries, First release, Flemming Madsen
- Re: [ANN] Penlight Libraries, First release, steve donovan
- Re: [ANN] Penlight Libraries, First release, David Manura
- Re: [ANN] Penlight Libraries, First release, steve donovan
- Re: [ANN] Penlight Libraries, First release, Mark Hamburg
- Re: [ANN] Penlight Libraries, First release, David Manura
- Re: [ANN] Penlight Libraries, First release, steve donovan
- Re: [ANN] Penlight Libraries, First release, David Manura
- Re: [ANN] Penlight Libraries, First release, steve donovan