B
Boris Schmid
Apologies, I have been out of using ruby for a while, and ran into
trouble when I tried to do the below. What is the normal way to call
apply a list of arguments to a list of functions?
def f1(n)
puts "f1: #{n}"
end
def f2(n)
puts "f2: #{n}"
end
irb(main):008:0> [f1,f2].each {|fun| [1,2,3,4].each {|val| fun(val)}}
trouble when I tried to do the below. What is the normal way to call
apply a list of arguments to a list of functions?
def f1(n)
puts "f1: #{n}"
end
def f2(n)
puts "f2: #{n}"
end
irb(main):008:0> [f1,f2].each {|fun| [1,2,3,4].each {|val| fun(val)}}