[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: multimimensional arrays - i am not getting it..

seebs

5/18/2007 9:31:00 PM

In message <f0314c659cd783e3f1a655cd7a5f9451@ruby-forum.com>, Mike Fletcher writes:
>a = Array.new( 3 ) { |idx| Array.new() }

>That will call the block once for each element, and that block will
>create a new (different) array instance each time it's called.

You could just do {[]} for the block. It DWYM.

-s