[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Struggling with variable arguments to block

ts

10/24/2003 4:26:00 PM

>>>>> "d" == dblack <dblack@superlink.net> writes:

d> I confess to confusion about the new arg/param semantics. For example:

d> irb(main):005:0> *a = 1,2
d> => [1, 2]
d> irb(main):006:0> *a = [1,2]
d> => [1, 2]

svg% ./ruby -ve '*a = 1,2; p a; *a = [1,2]; p a; *a = [[1,2]]; p a'
ruby 1.8.0 (2003-10-24) [i686-linux]
[1, 2]
[[1, 2]]
[[[1, 2]]]
svg%


Guy Decoux