Enumerable#detect is not returning the ifnone block when the no results are 
found
---------------------------------------------------------------------------------

                 Key: JRUBY-5058
                 URL: http://jira.codehaus.org/browse/JRUBY-5058
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.5.2
         Environment: RVM installed JRuby 1.5.2
Ubuntu 10.04 (64bit)
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)

            Reporter: Ryan Bell
            Assignee: Thomas E Enebo


Enumerable#detect should behave like Enumerable#find and return the result of 
the lambda if the no matches are found in the array.

[].find(lambda { "result" }) {|a| !a.nil?}
 => "result" 

[].detect(lambda { "result" }) {|a| !a.nil?}
 => nil 

-- 
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


Reply via email to