On Wed, Jun 6, 2012 at 10:09 AM, Nikita Popov <nikita....@googlemail.com>wrote:

> On Tue, Jun 5, 2012 at 8:32 PM, Kris Craig <kris.cr...@gmail.com> wrote:
> > Some observations and questions:
> >
> > In the RFC, the top example claims to make use of the file() function,
> but
> > in fact does not.  Did you mean fopen()?  Or did you mean that this to
> be an
> > example of someone writing their own file() function in PHP for some
> reason
> > (the "userland" reference is a bit confusing IMHO given the context).
> It's an implementation of the file() function in userland code (as
> opposed to the internal file() implementation). file() returns all
> lines from a file as an array.
>
> > In what way(s) do you believe this approach would differ from inline
> > functions and what advantage(s) do you see in those differences?
> I'm not sure what you mean by inline functions. PHP doesn't do
> function inlining (and it doesn't seem related to this). Or do you
> mean closures? Again, I'm not sure how closures are related to this.
>

Yes sorry, I meant closures.  I have the nasty habit of calling them
"inline functions," forgetting that that term already means something
completely different lol.

I guess the point I was making is that *closures* and generators are very
similar in many ways.  This isn't to say that generators are a bad idea (I
actually think it's an awesome idea), but the question occurred to me as to
whether or not generators will add any functionality that can't already be
accomplished (albeit somewhat more clumsily) via closures.  I tend to think
the answer to that probably lies in yields, but I think it would be
beneficial to address this-- along with some examples to illustrate this
advantage over closures in appropriate use-cases-- in the RFC.  I agree
with Stas that, while it's a great idea, the RFC itself is far from
complete.


>
> > What release version do you believe should be targetted for this?
> The next major version, i.e. PHP 5.5.
>

Ok good.  Just wanted to make sure we weren't talking about squeezing this
into 5.4 lol.  Personally, I think RFCs should specify the target PHP
version when applicable.  I know it's not required but I think it'd be a
good idea to get in that habit anyway IMHO.

--Kris

>
> Nikita
>

Reply via email to