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

block parameter incompatibility with CRuby #2720

Open
nagachika opened this Issue Feb 8, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@nagachika

nagachika commented Feb 8, 2015

The following script show the difference in block parameter treatment between mruby and CRuby(MRI).

[[:a,1]].each_with_object({}) do |(k, v), o|
  p [k,v,o]
end

mruby

% mruby -v
mruby 1.1.0 (2014-11-19)
% mruby block.rb
[[:a, 1], {}, nil]

CRuby(MRI)

% ruby -v block.rb
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13]
[:a, 1, {}]
% ruby -v block.rb
ruby 2.1.5p291 (2015-02-09 revision 49473) [x86_64-darwin13.0]
[:a, 1, {}]
% ruby -v block.rb
ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-darwin13.4.0]
[:a, 1, {}]
@schmurfy

This comment has been minimized.

Show comment
Hide comment
@schmurfy

schmurfy Mar 2, 2015

Contributor

I don't think using () to "explode" an array in individual variables like this is supported by mruby currently, see matz comment here: #1951
Since the linked issue is still open I imagine it is still in the same state.

Contributor

schmurfy commented Mar 2, 2015

I don't think using () to "explode" an array in individual variables like this is supported by mruby currently, see matz comment here: #1951
Since the linked issue is still open I imagine it is still in the same state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment