From: Christian Neukirchen Date: 2005-01-11T00:05:54+09:00 Subject: Re: Construct [*nil] works differently in 1.6 and 1.8 "Robert Klemme" writes: >> > Btw, for what do you need that? Just curious... >> >> I needed that rather often for convenience stuff (pass a single >> argument or a whole array of them etc.). > > Ah, I see. But for methods arguments it works quite good, doesn't it? > >>> def f(*a) p a end > => nil The splat operator works differently here. >>> f( "aa\nb" ) > ["aa\nb"] > => nil >>> f( "aab" ) > ["aab"] > => nil >>> f( "aab", "bb" ) > ["aab", "bb"] > => nil >>> f( 1,2,3 ) > [1, 2, 3] > => nil I usually had the arguments in an array that should be splatted. >> When I used [*ary] to do that, I had some "mysterious bugs" that only >> appeared if the particular string had a newline in it... it really >> took me some time to find those bugs. > > I imagine... > > Kind regards > > robert -- Christian Neukirchen http://kronavita.de/chris/