def quiz
a = Proc.new do
return 1
end
b = Proc.new do
return -1
end
c = Proc.new do |x, y|
return x.call * y.call
end
return c.call(a,b)
end
puts quiz
This Ruby script prints "1\n"
. Why?
No comments:
Post a Comment