Guest User

Untitled

a guest
Jan 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1.  
  2. #!/usr/bin/env ruby
  3. squarer = Proc.new{|x| x*x}
  4. cuber = Proc.new{|x| x*x*x}
  5. def m(x, proc1, proc2)
  6. puts "x: #{x}, first proc: #{proc1.call(x)}, second proc: #{proc2.call(x)}"
  7. end
  8. m(2, squarer, cuber)
Add Comment
Please, Sign In to add comment