[MacRuby-devel] [MacRuby] #246: NSMutableDictionary methods cannot retrieve values for Fixnum keys

MacRuby ruby-noreply at macosforge.org
Fri Apr 24 11:26:00 PDT 2009


#246: NSMutableDictionary methods cannot retrieve values for Fixnum keys
---------------------------------------+------------------------------------
 Reporter:  krishna.kotecha@…          |       Owner:  eloy.de.enige@…         
     Type:  defect                     |      Status:  new                     
 Priority:  critical                   |   Milestone:                          
Component:  MacRuby                    |    Keywords:  NSMutableDictionary Hash
---------------------------------------+------------------------------------

Comment(by krishna.kotecha@…):

 This bug was discovered whilst I was working through the MacRuby article
 on the  (see: Mac Dev Center
 http://developer.apple.com/mac/articles/scriptingautomation/cocoaappswithmacruby.html).

 The following is used as example code:

 {{{
 >> h.setObject 'bar', :forKey => 43
 => nil
 >> h
 => {42=>"foo", 43=>"bar"}
 }}}

 And of course, trying the following causes much confusion to the newcomer:

 {{{
 >> h[42]
 => nil
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/246#comment:2>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list