Enumerable should provide each_with_object
------------------------------------------
Key: JRUBY-5716
URL: http://jira.codehaus.org/browse/JRUBY-5716
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.6.1
Reporter: Brian McCallister
Ruby's Enumerable module defines an each_with_object method (
http://www.ruby-doc.org/core/classes/Enumerable.html#M001516 ) which jruby does
not.
jruby-1.6.1 :001 > [1,2,3].each_with_object("hello") {|a, b| puts "#{a} #{b}" }
NoMethodError: undefined method `each_with_object' for [1, 2, 3]:Array
from (irb):1:in `evaluate'
from org/jruby/RubyKernel.java:1088:in `eval'
Should be
ruby-1.9.2-p180 :001 > [1,2,3].each_with_object("hello") {|a, b| puts "#{a}
#{b}" }
1 hello
2 hello
3 hello
=> "hello"
ruby-1.9.2-p180 :002 >
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email