Afternoon,

A change in convention makes sense, and sounds much nicer than hacking
anything to make it work.

I do prefer this approach to yet-another-function.

Is changing convention all we would do though, or would we raise a warning
when handler is present and interface is not ?

Cheers
Joe

On Thu, Nov 17, 2016 at 11:49 AM, Nikita Popov <nikita....@gmail.com> wrote:

> 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
>

Reply via email to