[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: My first feeling of Ruby

Trans

10/19/2006 2:59:00 AM


Hal Fulton wrote:

> Conflict with block syntax. You can't say hash {"A"} meaningfully.
> In fact, I'm not certain why that returns an integer.

Huh? You must know. It's the #hash method:

irb(main):001:0> o = Object.new
=> #<Object:0xb7d06254>
irb(main):002:0> o.hash
=> -605540054
irb(main):003:0> o.hash { }
=> -605540054

2 Answers

Rick DeNatale

10/19/2006 7:33:00 PM

0

On 10/18/06, Trans <transfire@gmail.com> wrote:
>
> Hal Fulton wrote:
>
> > Conflict with block syntax. You can't say hash {"A"} meaningfully.
> > In fact, I'm not certain why that returns an integer.
>
> Huh? You must know. It's the #hash method:
>
> irb(main):001:0> o = Object.new
> => #<Object:0xb7d06254>
> irb(main):002:0> o.hash
> => -605540054
> irb(main):003:0> o.hash { }
> => -605540054
>

And stressing the, probably, obvious:

irb(main):001:0> hash
=> -605215560
irb(main):002:0> self.hash
=> -605215560

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denh...

Ernst Blofeld

9/15/2010 12:40:00 AM

0

On Sep 14, 10:06 am, rfisc...@sonic.net (Ray Fischer) wrote:
> >> You're really trying hard to justify your hatred of Obama.
>
> >I think you're even more clueless that usual about what I'm up to with
> >the whole "X is a fascist" schtick. Ditto for "chickenhawk."
>
> That isn't even a denial.

Sometimes I think you're even dimmer than your troll account pretends
to be.

There's a clue in the very first post of this thread.