[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: hash of hashes

Austin Ziegler

10/4/2003 2:25:00 AM

On Sat, 4 Oct 2003 10:52:51 +0900, Dave Brown wrote:
> In article <200310031434.31907.argentoff@rtelekom.ru>,
> Paul Argentoff <argentoff@rtelekom.ru> wrote:
> : On Friday 03 October 2003 14:04, Paul Argentoff wrote:
> : > How can I create $Subject for future population?
> : Let's put it this way: I need to create a nested hash which will be
> : populatedlater by referencing the keys in the subhashes. How can I do
> : this?

> You mean, er,

> irb(main):001:0> a=Hash.new({})
> => {}
> irb(main):002:0> a['foo']
> => {}

I don't think that's what you want:

irb(main):001:0> a = Hash.new({})
=> {}
irb(main):002:0> a['foo'].id
=> 21054224
irb(main):003:0> a['bar'].id
=> 21054224

-austin
--
austin ziegler * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2003.10.03
* 22.22.45