Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Anthony Ferrara
Brian, On Sun, Aug 12, 2012 at 4:08 PM, Brian Moon wrote: > Hi Nikita, > > I admit, I have ignored these threads as there was no RFC. So, some of > this may have been covered. > There was an RFC in those posts... It was just being iterated over. > Do you have a good example usage other than a

Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Levi Morrison
On Sun, Aug 12, 2012 at 8:25 PM, Brian Moon wrote: >>> I don't consider this a very good example. >> >> That's fine. You are entitled to your opinion. However, you didn't >> have to figure out the 106 lines of code that is the Post-Order >> iterator. That was a NIGHTMARE and I'm still not 100% c

Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Brian Moon
I don't consider this a very good example. That's fine. You are entitled to your opinion. However, you didn't have to figure out the 106 lines of code that is the Post-Order iterator. That was a NIGHTMARE and I'm still not 100% confident that it works as it is supposed to. The generator, on th

Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Levi Morrison
I guess to be completely honest, there would be a docblock above the generator code as well. So 14 lines. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Levi Morrison
On Sun, Aug 12, 2012 at 5:56 PM, Brian Moon wrote: > On 8/12/12 5:33 PM, Levi Morrison wrote: >> >> On Sun, Aug 12, 2012 at 2:08 PM, Brian Moon wrote: >>> >>> Do you have a good example usage other than a file? I don't find >>> fopen/fgets/fclose all that complicated. What are the other valid use

Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Brian Moon
On 8/12/12 5:33 PM, Levi Morrison wrote: On Sun, Aug 12, 2012 at 2:08 PM, Brian Moon wrote: Do you have a good example usage other than a file? I don't find fopen/fgets/fclose all that complicated. What are the other valid use cases for such a thing? One fabulous use case is creating an ite

Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Yahav Gindi Bar
On 13 באוג 2012, at 01:33, Levi Morrison wrote: > On Sun, Aug 12, 2012 at 2:08 PM, Brian Moon wrote: >> Do you have a good example usage other than a file? I don't find >> fopen/fgets/fclose all that complicated. What are the other valid use cases >> for such a thing? > > One fabulous use ca

Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Levi Morrison
On Sun, Aug 12, 2012 at 2:08 PM, Brian Moon wrote: > Do you have a good example usage other than a file? I don't find > fopen/fgets/fclose all that complicated. What are the other valid use cases > for such a thing? One fabulous use case is creating an iterator for a Binary Search Tree. A post

Re: [PHP-DEV] [RFC] Generators

2012-08-12 Thread Brian Moon
Hi Nikita, I admit, I have ignored these threads as there was no RFC. So, some of this may have been covered. Do you have a good example usage other than a file? I don't find fopen/fgets/fclose all that complicated. What are the other valid use cases for such a thing? Also, not allowing re

[PHP-DEV] Decorators Revisited

2012-08-12 Thread Anthony Ferrara
Hey all I've posted before about adding the ability to do dynamic decorators before. I think I have come up with a method to do so in core. Basically, the problem is that I can't create a decorator for a class at all. I would have to extend that class (with all of the coupling issues that brings)

[PHP-DEV] [RFC] Generators

2012-08-12 Thread Nikita Popov
Hi internals! I think there already was a lot of discussion on the generators, so it's time to move to the next step. I'd like to vote on the feature in two weeks, so this the "announce[ment] on internals@, by the author, with the intention of voting on it". https://wiki.php.net/rfc/generator

[PHP-DEV] How to implement a custom php_stream?

2012-08-12 Thread Edmundo Carmona
Hi! I'm in the process of implementing a custom php_stream that has to do some things to meet our demands. I have already gotten it to (mostly) work (php 5.2.19, just in case I will move to later versions when we move our PHP codebase to 5.3 and 5.4 so please bear with me... probably the issue