[MacRuby-devel] [MacRuby] #735: Array#reduce on an Array from CalCalendarStore returns nil

MacRuby ruby-noreply at macosforge.org
Tue Jun 1 19:42:09 PDT 2010


#735: Array#reduce on an Array from CalCalendarStore returns nil
----------------------------------+-----------------------------------------
 Reporter:  jankassens@…          |       Owner:  lsansonetti@…        
     Type:  defect                |      Status:  new                  
 Priority:  blocker               |   Milestone:  MacRuby 0.7          
Component:  MacRuby               |    Keywords:                       
----------------------------------+-----------------------------------------
 An array returned from the calendarstore framework behaves differently to
 a Ruby array, even though the ancestor classes are the same.
 {{{
 #!/usr/bin/env macruby
 framework 'calendarstore'

 predicate = CalCalendarStore.eventPredicateWithStartDate(NSDate.date,
 endDate:NSDate.date,
 calendars:CalCalendarStore.defaultCalendarStore.calendars)
 events =
 CalCalendarStore.defaultCalendarStore.eventsWithPredicate(predicate)

 array = []

 p events                  # []
 p array                   # []
 p events.class.ancestors  # [Array, NSMutableArray, NSArray, Enumerable,
 NSObject, Kernel]
 p array.class.ancestors   # [Array, NSMutableArray, NSArray, Enumerable,
 NSObject, Kernel]
 p events.reject { false } # nil
 p array.reject { false }  # []
 }}}
 tested with trunk r4182

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/735>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list