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

block parameter incompatibility with CRuby #2720

Closed
nagachika opened this issue Feb 8, 2015 · 2 comments
Closed

block parameter incompatibility with CRuby #2720

nagachika opened this issue Feb 8, 2015 · 2 comments

Comments

@nagachika
Copy link

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
Copy link
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.

@matz
Copy link
Member

matz commented May 16, 2022

Fixed.

@matz matz closed this as completed May 16, 2022
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

3 participants