Re: [PHP-DEV] Implement Generator::__invoke($value) as alias to Generator::send($value)

2016-05-20 Thread Niklas Keller
2016-05-20 16:47 GMT+02:00 S.A.N :

> 2016-05-20 17:41 GMT+03:00 Niklas Keller :
> > 2016-05-20 15:34 GMT+02:00 S.A.N :
> >>
> >> Many interfaces work with callback functions, but they might work with
> >> the generators, if there was a method Generator::__invoke($value).
> >
> >
> > You can just use [$generator, "send"].
> >
>
> Yes, but it is slow and not nice :)
>

I agree, but this is a general issue, nothing special to generators.


Re: [PHP-DEV] Implement Generator::__invoke($value) as alias to Generator::send($value)

2016-05-20 Thread S.A.N
2016-05-20 17:41 GMT+03:00 Niklas Keller :
> 2016-05-20 15:34 GMT+02:00 S.A.N :
>>
>> Many interfaces work with callback functions, but they might work with
>> the generators, if there was a method Generator::__invoke($value).
>
>
> You can just use [$generator, "send"].
>

Yes, but it is slow and not nice :)

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DEV] Implement Generator::__invoke($value) as alias to Generator::send($value)

2016-05-20 Thread Niklas Keller
2016-05-20 15:34 GMT+02:00 S.A.N :

> Many interfaces work with callback functions, but they might work with
> the generators, if there was a method Generator::__invoke($value).


You can just use [$generator, "send"].


[PHP-DEV] Implement Generator::__invoke($value) as alias to Generator::send($value)

2016-05-20 Thread S.A.N
Many interfaces work with callback functions, but they might work with
the generators, if there was a method Generator::__invoke($value).

I apologize if this topic has been discussed.
Thank.

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php