R
Ronald Fischer
Below is a code snippet which gives me some headache:
def headache
yield(*(foo(1)),"bar")
end
def foo(n)
[n,n+2,n+5]
end
headache { |a,b,c,d| puts a.to_s; puts b.to_s; puts c.to_s; puts d }
I had expected that this would print
--=20
Ronald Fischer <[email protected]>
Phone: +49-89-452133-162
=20
def headache
yield(*(foo(1)),"bar")
end
def foo(n)
[n,n+2,n+5]
end
headache { |a,b,c,d| puts a.to_s; puts b.to_s; puts c.to_s; puts d }
I had expected that this would print
--=20
Ronald Fischer <[email protected]>
Phone: +49-89-452133-162
=20