Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different behavior of instance_eval #3029

Closed
takahashim opened this issue Nov 20, 2015 · 0 comments
Closed

different behavior of instance_eval #3029

takahashim opened this issue Nov 20, 2015 · 0 comments

Comments

@takahashim
Copy link
Contributor

@takahashim takahashim commented Nov 20, 2015

In CRuby, I can get the receiver through block argument, but in mruby, I can't.
Is it mruby's limitation?

$ cat tmp.rb
class Foo
  def initialize(&block)
    self.instance_eval(&block)
  end
end

Foo.new{ |arg| p arg }

$ ruby tmp.rb
#<Foo:0x007f97ca038798>
$ ./bin/mruby tmp.rb
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant