[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Running multiple closures per iteration

dohzya

8/4/2007 9:52:00 AM

Le samedi 04 août 2007 à 02:38 +0900, Joshua Chia a écrit :
> o = a.select {|x| x >= 0}
> p = a.inject(0) {|s, x| s += x}

def truc( a, sel, &inj )
o = a.select sel.call
p = a.inject(0) &inj
end

truc( a, proc{|x| x >= 0} ){|s, x| s += x}

--
Etienne Vallette d'Osia


1 Answer

The Peeler

2/13/2011 12:33:00 PM

0

On Sun, 13 Feb 2011 08:32:31 +0100, Dumb Heini, the Dutch resident Nazi
troll of sci and scj, wrote:

>>> mayor added
>>
>> bloomie is stuck on stupid..
>>
>>
>> there was an old jewish lady taking her first airline flight. she was
>> seated next to a big man. to break the ice she asked: "pardon me. what
>> do you think of arthur goldberg?" the man said "he's a fooking
>> disrace!" the woman wa bewildered and stayed silent for awhile. then
>> she inquired "what do ypu think of barbra streisand"? the man
>> said"she sucks!' The woman then asked: "excuse me, whay is your ethnic
>> background?" the man said"I'm irish." At that point the old jewish
>> lady said: "fuck ella fitzgerald then!"
>
> lol a good one, william

<BG> You didn't even understand it, you atrociously stupid senile Dutch Nazi
oaf! Come on, explain the punch line!


--
Dumb Heini about himself: "i was diagnozed with the syndromeof asperger, no
idea what it means but i am feelingperfectly oke"
MID: <7u8b41FjtnU1@mid.individual.net>