[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Memoization?

John Carter

1/26/2006 8:59:00 PM

5 Answers

Dave Howell

1/26/2006 9:18:00 PM

0


On Jan 26, 2006, at 12:59, John Carter wrote:

> OK, so this trick cannot be used everywhere.
>
> Suppose @@memo is a brand spanking new empty Hash object.
>
> What does @@memo["pink"] return?
>
> By default it returns nil.
>
> But you can make it return whatever you damn well feel like.
>
> @@memo = Hash.new{|hash,key| hash[key] = Car.new(key)}
>
> @@memo["pink"]
>
> Will say, oo, I have no "pink" element, I better go off and make one
> then, fortunately I have a block on my "new" so I know how to do that.
>
> ps.
>
> If everybody in your country had a pink car, what would you have?

Ha ha. Except that if everybody in my country had a
Car.create_car("pink") car, then the entire country would have exactly
one car. I can't figure out what it's good for; any example I can think
of in my head is just a complicated way of doing something simple.
Either "well, I'll just keep the object around in the first place," or
"no, I would have to have my very OWN pink car, not be FlexCar-ing it
with other parts of the program"



The Peeler

7/4/2013 10:22:00 AM

0

On Wed, 03 Jul 2013 22:39:48 -0700, The Rectum, the resident psychopath of
sci and scj, FAKING his time zone again and IMPERSONATING his master, The
Peeler, wrote:

>> You know who I mean!
>>
>> I just saw you've been online ALL DAY LONG again, waiting for ANY posts to
>> appear, you hilarious abnormal psychotic swine!
>>
>> They just can't come any dumber than you!


AHAHAHAHAHAAAAAA!!! They REALLY can't come any dumber than you! LMAO!

--
Retarded, anal, subnormal and extremely proud of it: our resident
psychopath, The Retard (aka "The Rectum").

The Peeler

7/4/2013 4:59:00 PM

0

On Thu, 04 Jul 2013 06:07:16 -0700, The Rectum, the resident psychopath of
sci and scj, FAKING his time zone again and IMPERSONATING his master, The
Peeler, wrote:

>> >> You know who I mean!
>> >>
>> >> I just saw you've been online ALL DAY LONG again, waiting for ANY posts to
>> >> appear, you hilarious abnormal psychotic swine!
>> >>
>> >> They just can't come any dumber than you!
>>
>>
>> AHAHAHAHAHAAAAAA!!! They REALLY can't come any dumber than you! LMAO!
>
> They, REALLY can't innit The Grik anus! LMAO111

So, you know it yourself! Fucking hilarious LMAO!!!!

--
Retarded, anal, subnormal and extremely proud of it: our resident
psychopath, The Retard (aka "The Rectum").

The Peeler

7/5/2013 4:10:00 PM

0

On Thu, 4 Jul 2013 18:58:46 +0200, The Peeler
<finishingoff@themoronicRevd.invalid> wrote:

>>> AHAHAHAHAHAAAAAA!!! They REALLY can't come any dumber than me! LMAO!
>>
>> They, REALLY can't innit The Grik anus! LMAO111
>
>So, I know it myself! Fucking hilarious LMAO!!!!

Fucking! Innit anus! LMAO111

The Peeler

7/5/2013 4:57:00 PM

0

On Fri, 05 Jul 2013 09:10:08 -0700, The Rectum, the resident psychopath of
sci and scj, FAKING his time zone again and IMPERSONATING his master, The
Peeler, wrote:

>> >> AHAHAHAHAHAAAAAA!!! They REALLY can't come any dumber than you! LMAO!
>> >
>> > They, REALLY can't innit The Grik anus! LMAO111
>>
>> So, you know it yourself! Fucking hilarious LMAO!!!!
>
> Fucking! Innit anus! LMAO111

Yeah, it IS fucking hilarious, except that you CAN'T fuck! LMAO!

--
Michael about "The Rectum":
"He is a mangina- the shape of a man, the masculinity of a vagina."
MID: <00f49a20-09c5-4e66-92b7-f8fe966a9359@ou9g2000pbb.googlegroups.com>