Skip to content

Instantly share code, notes, and snippets.

@simonoff
Created September 14, 2010 20:10
Show Gist options
  • Save simonoff/579678 to your computer and use it in GitHub Desktop.
Save simonoff/579678 to your computer and use it in GitHub Desktop.
def meth1
puts "method start"
pr = lambda { return }
pr.call
puts "method end"
end
def meth2
puts "method start"
pr = Proc.new { return }
pr.call
puts "method end"
end
def meth3
puts "method start"
pr = proc { return }
pr.call
puts "method end"
end
puts "Using lambda"
meth1
puts "--------"
puts "using Proc.new"
meth2
puts "--------"
puts "using proc"
meth3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment