Re: [MacRuby-devel] NSArray's count and Ruby Array#count

2010-10-05 Thread Caio Chassot
On 2010-10-05, at 18:15 , Laurent Sansonetti wrote: > > You found out an exception :) As you know, NSArray responds to -count which > simply return the number of elements it contains. But Ruby Array defines > #count which has different semantics. > > To not conflict with NSArray, the Ruby #coun

Re: [MacRuby-devel] NSArray's count and Ruby Array#count

2010-10-05 Thread Laurent Sansonetti
Hi Caio, You found out an exception :) As you know, NSArray responds to -count which simply return the number of elements it contains. But Ruby Array defines #count which has different semantics. To not conflict with NSArray, the Ruby #count is only defined on Ruby arrays. However, I do not un

[MacRuby-devel] NSArray's count and Ruby Array#count

2010-10-04 Thread Caio Chassot
Hi all, Code first: cocoa_array = NSArray.new ruby_array = [] puts ruby_array.count # => 0 puts ruby_array.count { true } # => 0 puts ruby_array.count("whatever") # => 0 puts cocoa_array.count # => 0 puts cocoa_array.count { true }