On Mon, Apr 18, 2011 at 20:18, Joshua Ballanco wrote:
> they aren't...quite... The issue is that if you need a string, sometimes an
> NSString is sufficient and in those cases you'd want the NSString to report
> itself as being the same as a String. In other cases, however, they are
> different be
Actually, it's quite a bit more complicated than that.
NSString, NSDictionary, and NSArray are class clusters. In practice, you are
never actually dealing with an "NSString", but rather a specialized subclass
in the class cluster. Originally, String in MacRuby was implemented using
NSCFString (one
On Mon, Apr 18, 2011 at 10:40 AM, Ricky Chilcott
wrote:
>
> I'd noticed that too. I thought Strings were actually NSStrings.
>
They are NSMutableStrings/NSStrings underneath:
irb(main):013:0> "string".class.ancestors
=> [String, NSMutableString, NSString, Comparable, NSObject,
PP::ObjectMixin, K
I'd noticed that too. I thought Strings were actually NSStrings.
Ricky
On Apr 18, 2011, at 9:52 AM, Petr Kaleta wrote:
> Btw: it seems, that something has changed in ruby primitives classes
> implementation, described in here
> http://www.macruby.org/documentation/tutorial.html (this example
Btw: it seems, that something has changed in ruby primitives classes
implementation, described in here
http://www.macruby.org/documentation/tutorial.html (this example
http://cl.ly/2Y382r0w331O230z1Q3D) because "foo".class is not NSCFString but
String http://cl.ly/110Y0O0D1k3y1G2e2j2X
- Petr
Hi I'm a little bit confused about basic ruby classes implementation. Ruby Hash
is internally implemented as NSDictionary/NSMutableDictionary? So for example
if I need to implement hash table, I can use ruby Hash? So the performance will
be exactly same compared to NSDictionary?
- Petr