[MacRuby] #1141: NSArray.new.class should be "NSArray"
#1141: NSArray.new.class should be "NSArray" ----------------------------------------+----------------------------------- Reporter: vincent.isambart@… | Owner: lsansonetti@… Type: defect | Status: new Priority: critical | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Even though NSArray's behavior is different from Array, Array.new.class, NSArray.new.class and NSMutableArray.new.class all return "Array". The user should be able to easily differentiate between Ruby arrays and Cocoa arrays so NSArray instances should not pretend to be Array instances. We should also consider doing it for NSDictionary and NSString. -- Ticket URL: <http://www.macruby.org/trac/ticket/1141> MacRuby <http://macruby.org/>
#1141: NSArray.new.class should be "NSArray" ----------------------------------------+----------------------------------- Reporter: vincent.isambart@… | Owner: lsansonetti@… Type: defect | Status: new Priority: critical | Milestone: MacRuby 1.0 Component: MacRuby | Keywords: ----------------------------------------+----------------------------------- Comment(by mrada@…): Similarly, NSString should be NSString and not String. Today I tried to add #to_url to the String class. I wrote a small test case for it where I get the #absoluteString from an NSURL and transform it back into a NSURL. But #absoluteString returns an NSString pretending to be a String, which does not have the #to_url method. The error message I got from the test was that #to_url was not defined for String objects. I was confused as to why I was seeing that output. I will attach a short script to demonstrate. -- Ticket URL: <http://www.macruby.org/trac/ticket/1141#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby