From: matt_neuburg@... (Matt Neuburg) Date: 2009-06-14T01:55:12+09:00 Subject: Re: Last element skip in array mapping Len Lawrence wrote: > Still a newbie after 2 years, investigating obscure corners of the > language (version 1.8). I made some tests based on a discussion in > _why's "bits" RedHanded blog: > > a = [ 1, 2, 3, 4, 5, nil ] > b = [ 1, 2, 3, 4, 5 ] > x = a.map { |k| k.to_s }.join( "0\n" ) > puts x > > s = a.map { |k| k }.join( "0\n" ) > puts s > > z = a.to_a.join( "00\n" ) > puts z > > beep = b * "000\n" > puts beep > > Unless the dummy element is added to the array (as in a) the series does > not complete for any of the mapping methods. Am I missing something here? Consider: puts [1].join("0") puts [1, nil].join("0") m.