#735: Array#reduce on an Array from CalCalendarStore returns nil ----------------------------------+----------------------------------------- Reporter: jankass...@… | Owner: lsansone...@… 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/> _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel