[MacRuby-devel] 0.7 problems with complex index in a hash

Laurent Sansonetti lsansonetti at apple.com
Sat May 8 13:35:41 PDT 2010


Hi,

On May 8, 2010, at 5:02 AM, B. Ohr wrote:
> Hi, 
> 
> v0.7 has a different behavior than v0.5 when using a Cocoa-Obj (NSCalendarDate) as a key in a hash.
> 
> I must admit that I do not know what is exactly specified in Ruby, but obviously the generated value of an hashkey of different objects is same in all other cases if the objects itself are identical:
> 
> - Bernd
> 
> ---
> 
> $ macruby_select 0.7 h.rb 
> {#<NSCalendarDate:0x2000df2a0>=>:x, #<NSCalendarDate:0x2000c7fa0>=>:y}    # <==== is this ok????????

Nope, looks like you found a bug. Could you report that in the tracker?

As a workaround, you can create the hash object using `NSMutableDictionary.dictionary'.

Laurent


More information about the MacRuby-devel mailing list