Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- squarer = Proc.new{|x| x*x}
- cuber = Proc.new{|x| x*x*x}
- def m(x, proc1, proc2)
- puts "x: #{x}, first proc: #{proc1.call(x)}, second proc: #{proc2.call(x)}"
- end
- m(2, squarer, cuber)
Add Comment
Please, Sign In to add comment