Skip to content

Instantly share code, notes, and snippets.

@bachue
Created October 12, 2013 14:37
Show Gist options
  • Save bachue/6950648 to your computer and use it in GitHub Desktop.
Save bachue/6950648 to your computer and use it in GitHub Desktop.
Why there's no `yield` in Proc.new but Proc.new can accept the block of the caller?
def f
Module.new &Proc.new
end
M = f do
def self.x
'hello world'
end
end
M.x # => "Hello world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment