On Thu, Nov 17, 2016 at 8:30 AM, Joe Watkins <pthre...@pthreads.org> wrote:
> Morning, > > Just to chime in ... can you split the PR into the RFC, and the new thing > please. > > Just another question on how we could make objects that have > count_elements (which is in object handlers) implement an interface on the > class entry (which is detached from handlers) ? > > I'm sure it's doable, but it doesn't look very straight forward, some kind > of hacking in instanceof maybe ... not sure ... > I don't think this needs any magic. We simply implement the interface by convention. Just like you are supposed to implement Traversable if you're implementing get_iterator. Similarly you should implement Countable if you're using count_elements. Nikita