L
Len Lawrence
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?
Len
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?
Len