[#1611] set_trace_func/Array#fetch error — "Nathaniel Talbott" <nathaniel@...>

I've reduced the error I reported in ruby-talk:84013 to the following code:

17 messages 2003/10/11

Re: set_trace_func/Array#fetch error

From: ts <decoux@...>
Date: 2003-10-11 17:03:10 UTC
List: ruby-core #1614
>>>>> "d" == daz  <dooby@d10.karoo.co.uk> writes:

>> def m
>> [].fetch(2) {return nil}

d>       [].fetch(2) {nil}  # <--------- see Array#fetch w/ block

 No, no : this is volontary. See lib/optparse.rb

    def search(id, key)
      if list = __send__(id)
        val = list.fetch(key) {return nil}
        return val unless block_given?
        yield(val)
      end
    end



Guy Decoux


In This Thread