[PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-25 Thread Reeze Xia
Hi, 在 2012年7月25日星期三,下午1:27,Laruence 写道: Hi: is there any really usage? I didn't see before. I don't think every Yes, eg: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L24 it could be: from Doctrine\Common\Collections use ExpressionBuilder,

Re: [PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-25 Thread Leigh
What about expanding the syntax instead of introducing new reserved words. use A\B { Class1, Class2 }

[PHP-DEV] Re: 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-25 Thread Laruence
On Wed, Jul 25, 2012 at 2:43 PM, Reeze Xia reeze@gmail.com wrote: Hi, 在 2012年7月25日星期三,下午1:27,Laruence 写道: Hi: is there any really usage? I didn't see before. I don't think every Yes, eg: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L24 it

Re: [PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-25 Thread Laruence
On Wed, Jul 25, 2012 at 2:54 PM, Leigh lei...@gmail.com wrote: What about expanding the syntax instead of introducing new reserved words. use A\B { Class1, Class2 } better than from :). and a little consistent with use traits in class thanks -- Laruence Xinchen Hui

Re: [PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/

2012-07-25 Thread Ryan McCue
Johannes Schlüter wrote: Thanks for the advise! I hope nobody was affected as we had the issue for less than an hour. Out of interest, why did you use `reset --hard` rather than `revert`? The latter would have avoided contaminating repositories that had already merged it in, and having two

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-25 Thread Xinchen Hui
On Wed, Jul 25, 2012 at 3:23 AM, Galen Wright-Watson ww.ga...@gmail.com wrote: On Tue, Jul 24, 2012 at 5:03 AM, Xinchen Hui larue...@gmail.com wrote: Sent from my iPhone 在 2012-7-24,19:51,Rafael Kassner kass...@gmail.com 写道: Thanks Laruence. If I perform something like this: function

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-25 Thread Laruence
On Tue, Jul 24, 2012 at 9:43 PM, Andrew Faulds a...@ajf.me wrote: On 24/07/12 14:40, Levi Morrison wrote: On Tue, Jul 24, 2012 at 7:35 AM, Nikita Popov nikita@gmail.com wrote: On Tue, Jul 24, 2012 at 1:20 PM, Laruence larue...@php.net wrote: Hi: As the previous threads

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/25 Sherif Ramadan theanomaly...@gmail.com: PHP made implementation mistakes in the past that led to awkward behavior (like objects passed by value in PHP4), but that's never stopped things from moving forward and offering up useful features that users want. I think putting the technical

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Alex Aulbach wrote: PHP made implementation mistakes in the past that led to awkward behavior (like objects passed by value in PHP4), but that's never stopped things from moving forward and offering up useful features that users want. I think putting the technical details aside the engine can

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Sherif Ramadan
I like that kind of agile programming, too. But if someone like me says come on, lets make it a little bit more easy, because returning objects from functions is some kind of unconventional; many developers will make mistakes here... - why not? They will. I can tell by sure. What are

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Sherif Ramadan wrote: Just between PHP 5.2 and 5.4 we've gained traits, closures, namespaces, function array derefrencing, access to member upon instantiation, and lots of other lovely additions to the language. I don't see languages like Java or Python evolving this quickly -- by contrast.

[PHP-DEV] strict compliance ...

2012-07-25 Thread Lester Caine
I know I'll be kicked somewhere else, but I think it's important that the general community appreciates what is going on ... I've cleared the bulk of the 'strict' warnings on bitweaver, and in the libraries, but now I'm down to PEAR ... is there a version of PEAR that is strict compliant?

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Ferenc Kovacs
( I'll start a new thread for my other rant ... ) nah, you won't, you will bring that up in every thread instead. -- Ferenc Kovács @Tyr43l - http://tyrael.hu

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Sherif Ramadan
Just between PHP 5.2 and 5.4 we've gained traits, closures, namespaces, function array derefrencing, access to member upon instantiation, and lots of other lovely additions to the language. I don't see languages like Java or Python evolving this quickly -- by contrast. But now we also need

Re: [PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/

2012-07-25 Thread Johannes Schlüter
On Wed, 2012-07-25 at 17:05 +1000, Ryan McCue wrote: Johannes Schlüter wrote: Thanks for the advise! I hope nobody was affected as we had the issue for less than an hour. Out of interest, why did you use `reset --hard` rather than `revert`? The latter would have avoided contaminating

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
Like they have already... :/ Sent from Samsung Mobile Ferenc Kovacs tyr...@gmail.com wrote: ( I'll start a new thread for my other rant ... ) nah, you won't, you will bring that up in every thread instead. -- Ferenc Kovács @Tyr43l - http://tyrael.hu

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Sherif Ramadan wrote: I don't see anything about these particular features that isn't already documented. Albeit there are parts of the documentation that could always use a bit of refinement every now and then. With that said, the manual isn't a place to tell people how a particular feature

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
Generators aren't for you, then, they are for people like me who, for example, used a C# generator for yielding tokens, or, for example, use generators to iterate element by element through multi-dimensional arrays. -- Sent from Samsung Mobile Andrew Faulds http://ajf.me/ Lester Caine

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Andrew Faulds wrote: Generators aren't for you, then, they are for people like me who, for example, used a C# generator for yielding tokens, or, for example, use generators to iterate element by element through multi-dimensional arrays. Such as the family tree created by iterating through a

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/25 Sherif Ramadan theanomaly...@gmail.com: I don't understand what you find non-conventional about functions or methods that return objects. Again: I don't have any problems with the object returning. :) I see a problem that the mechanism isn't understood and used wrong. And I think,

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/25 Andrew Faulds a...@ajf.me: Generators aren't for you, then, they are for people like me who, for example, used a C# generator for yielding tokens, or, for example, use generators to iterate element by element through multi-dimensional arrays. Then make it in the PHP way not in the

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Sherif Ramadan
Again: I don't have any problems with the object returning. :) I see a problem that the mechanism isn't understood and used wrong. Isn't understood by who? Used wrong by who? Are we talking about people using a feature, that doesn't exist yet in PHP, the wrong way and arguing that there

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
We, of course, should try to avoid user confusion if it will be a big issue. But I don't see any here. Also, 20 years experience does not necessarily a good programmer make, nor an expert in other programmers. -- Sent from Samsung Mobile Andrew Faulds http://ajf.me/ Sherif Ramadan

Re: [PHP-DEV] strict compliance ...

2012-07-25 Thread Lester Caine
Alan Knowles wrote: I did start making fixes, but it drove me up the wall, the pointlessness and stupidity of this change... Eventually I just disabled E_STRICT in the bootstrap code... THAT is one of the things that messed me up originally. I had not realised that one of the libraries was

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Ferenc Kovacs
I use PHP every day, but as explained most PHP-developers will have problems and I can say that, because I've more than 20 years experience in that. Do you have that? http://en.wikipedia.org/wiki/Appeal_to_authority I'm just wondering... for whom is PHP developed, for the PHP-internals

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Sherif Ramadan wrote: ... I have no problem with it, I use PHP every day, but as explained most PHP-developers will have problems and I can say that, because I've more than 20 years experience in that. Do you have that? 20 years experience in PHP? No, I believe it only ever appeared

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 15:19, Lester Caine wrote: Sherif Ramadan wrote: ... I have no problem with it, I use PHP every day, but as explained most PHP-developers will have problems and I can say that, because I've more than 20 years experience in that. Do you have that? 20 years experience in PHP? No,

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Andrew Faulds wrote: I top you 20 years with 37 years. I was programming in Algol in 1975 ( at Warwick university ). I'm not a programmer, I'm a hardware engineer who has to program to make systems work. I added PHP 12 years ago to create web based applications to augment c and Pascal based

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 16:11, Lester Caine wrote: Andrew Faulds wrote: I top you 20 years with 37 years. I was programming in Algol in 1975 ( at Warwick university ). I'm not a programmer, I'm a hardware engineer who has to program to make systems work. I added PHP 12 years ago to create web based

Re: [PHP-DEV] Internal iteration API

2012-07-25 Thread jpauli
On Wed, Jul 25, 2012 at 6:52 AM, Larry Garfield la...@garfieldtech.com wrote: On 07/24/2012 03:52 AM, jpauli wrote: On Sat, Jul 14, 2012 at 2:35 AM, Stas Malyshev smalys...@sugarcrm.com wrote: Hi! So, I've not been inside the engine so in practice this may make no sense at all, but what

[PHP-DEV] PHP6 wiki page

2012-07-25 Thread Andrew Faulds
Is there a PHP 6 wiki page for co-ordinating development of and collecting ideas for PHP6 development? There are a lot of idea being thrown around, would be nice if we had a page (there might be one, but I can't find it). Thanks. -- Andrew Faulds http://ajf.me/ -- PHP Internals - PHP

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/25 Ferenc Kovacs tyr...@gmail.com: more than 20 years experience in that. Do you have that? http://en.wikipedia.org/wiki/Appeal_to_authority So what? U are using Wikipedia to invalidate me. :) shrug Is it so bad to hear an people with more experience? Do you have problems with it with

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Andrew Faulds wrote: Boo hoo, PHP has new features, you'll have to understand them, shock horror! Actually I've not even look at some of these newfangled bits, and if they did appear in one of my key libraries then I'd definitely fork a version and maintain my own copy! I'm STILL trying to

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Ferenc Kovacs
On Wed, Jul 25, 2012 at 5:11 PM, Lester Caine les...@lsces.co.uk wrote: Andrew Faulds wrote: I top you 20 years with 37 years. I was programming in Algol in 1975 ( at Warwick university ). I'm not a programmer, I'm a hardware engineer who has to program to make systems work. I added PHP 12

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 16:37, Alex Aulbach wrote: 2012/7/25 Ferenc Kovacs tyr...@gmail.com: more than 20 years experience in that. Do you have that? http://en.wikipedia.org/wiki/Appeal_to_authority So what? U are using Wikipedia to invalidate me. :) shrug Is it so bad to hear an people with more

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/25 Andrew Faulds a...@ajf.me: We, of course, should try to avoid user confusion if it will be a big issue. But I don't see any here. I said it's small and the fix is small also. Big issue, big fix, small issue, small fix. Understand? Also, 20 years experience does not necessarily a

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Ferenc Kovacs
He linked to the Wikipedia Appeal to authority article because it's a common logical fallacy. Experience alone does not make you any more right than somebody else, and in the same way, someone without it is not less right. Also, I have 16 years of experience at life, so obviously I'm an

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 16:43, Alex Aulbach wrote: 2012/7/25 Andrew Faulds a...@ajf.me: We, of course, should try to avoid user confusion if it will be a big issue. But I don't see any here. I said it's small and the fix is small also. Big issue, big fix, small issue, small fix. Understand? Also, 20

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 16:47, Ferenc Kovacs wrote: He linked to the Wikipedia Appeal to authority article because it's a common logical fallacy. Experience alone does not make you any more right than somebody else, and in the same way, someone without it is not less right. Also, I

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Ferenc Kovacs
On Wed, Jul 25, 2012 at 5:37 PM, Alex Aulbach alex.aulb...@gmail.comwrote: 2012/7/25 Ferenc Kovacs tyr...@gmail.com: more than 20 years experience in that. Do you have that? http://en.wikipedia.org/wiki/Appeal_to_authority So what? U are using Wikipedia to invalidate me. :) shrug Is it

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 16:51, Ferenc Kovacs wrote: On Wed, Jul 25, 2012 at 5:37 PM, Alex Aulbach alex.aulb...@gmail.com mailto:alex.aulb...@gmail.com wrote: 2012/7/25 Ferenc Kovacs tyr...@gmail.com mailto:tyr...@gmail.com: more than 20 years experience in that. Do you have that?

Re: [PHP-DEV] PHP6 wiki page

2012-07-25 Thread Ferenc Kovacs
On Wed, Jul 25, 2012 at 5:20 PM, Andrew Faulds a...@ajf.me wrote: Is there a PHP 6 wiki page for co-ordinating development of and collecting ideas for PHP6 development? There are a lot of idea being thrown around, would be nice if we had a page (there might be one, but I can't find it).

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Thomas Hruska
On 7/25/2012 7:50 AM, Andrew Faulds wrote: On 25/07/12 15:19, Lester Caine wrote: Sherif Ramadan wrote: ... I have no problem with it, I use PHP every day, but as explained most PHP-developers will have problems and I can say that, because I've more than 20 years experience in that. Do you

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Ferenc Kovacs wrote: some/most of the E_STRICT messages are telling you about (possible) problems in your code. The major hurdle here is 'static', and not being able to use a function both statically or with $this. PEAR is currently throwing these 'warnings' so is there problems in the PEAR

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 17:09, Lester Caine wrote: Ferenc Kovacs wrote: some/most of the E_STRICT messages are telling you about (possible) problems in your code. The major hurdle here is 'static', and not being able to use a function both statically or with $this. PEAR is currently throwing these

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Andrew Faulds wrote: Do you use PHP objects and classes at all? Because if you do, then your PHP5 code SHOULDN'T work in PHP4. Perhaps it does, but I find that very suspicious. And you shouldn't rely on it. http://lsces.org.uk/hg/ https://github.com/bitweaver http://cia.vc/stats/author/lsces

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/25 Andrew Faulds a...@ajf.me: Experience can be helpful. But you must support things with facts Ok, I tried to bring all the pro arguments together. Suggestion: For a generator, rename the keyword function to ... generator or something like that. Example: generator hugo() {

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 17:54, Alex Aulbach wrote: 2012/7/25 Andrew Faulds a...@ajf.me: Experience can be helpful. But you must support things with facts Ok, I tried to bring all the pro arguments together. Suggestion: For a generator, rename the keyword function to ... generator or something like that.

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Dave Ingram
Fact: Adding a new name for a special kind of function as a syntax construct is going to cost (possibly unnecessary) time and energy, because now you have functions, and weird things that look almost like functions but aren't and can only be used to make generators. Just to put my oar in too,

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Andrew Faulds
On 25/07/12 18:58, Dave Ingram wrote: Fact: Adding a new name for a special kind of function as a syntax construct is going to cost (possibly unnecessary) time and energy, because now you have functions, and weird things that look almost like functions but aren't and can only be used to make

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Nikita Popov
Just please don't forget that generator isn't quite a rare word (unlike yield), so there are high chances for collisions (in particular with namespaced code). So if you have some kind of Code\Generator class, you're screwed. Keywords don't grow on trees, you know ;) Also I'd like to point out

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Lester Caine wrote: Do you use PHP objects and classes at all? Because if you do, then your PHP5 code SHOULDN'T work in PHP4. Perhaps it does, but I find that very suspicious. And you shouldn't rely on it. http://lsces.org.uk/hg/ https://github.com/bitweaver http://cia.vc/stats/author/lsces I

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Stas Malyshev
Hi! Speaking of parse errors, I'm having trouble parsing this line. I *think* you're saying that generators are just complex things and that's the way it should be. I... guess I agree, though I have a lower opinion on the complexity of generators. Seem like a fairly straightforward concept

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Lester Caine
Sara Golemon wrote: Fact: yield makes functions some kind of different. Yes, they turn normal functions into continuation functions (functions which can be exited and reentered dynamically). But WHY would you not simply put the function that is handling the returned data in place of the

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Sara Golemon
Suggestion: For a generator, rename the keyword function to ... generator or something like that. Example: generator hugo() { yield ... } As Nikita pointed out, having a T_GENERATOR token will cause side-effect problems from namespace collisions. This is a concern any

[PHP-DEV] RFCs and organisation

2012-07-25 Thread Andrew Faulds
Hi there, First off I'd like to apologise for being a generally useless and overly reactive poster on this list. I'm going to exercise more self-constraint now after noticing I made more posts on this list this month than anyone else, this month. Anyway, onto the subject of this email, in

RE: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Jared Williams
-Original Message- From: Nikita Popov [mailto:nikita@gmail.com] Sent: 22 July 2012 16:53 To: Jared Williams Cc: Nikita Popov; PHP internals Subject: Re: [PHP-DEV] Re: Generators in PHP On Sat, Jul 21, 2012 at 6:31 PM, Jared Williams jared.willia...@ntlworld.com wrote:

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/25 Nikita Popov nikita@gmail.com: particular with namespaced code). So if you have some kind of Code\Generator class, you're screwed. Keywords don't grow on trees, you know ;) Hm. Ok, thats a problem. Oh, man, do I really have to find a good keyword myself? Maybe we should use a

Re: [PHP-DEV] Generators in PHP

2012-07-25 Thread Yahav Gindi Bar
On 26 ביול 2012, at 01:22, Alex Aulbach alex.aulb...@gmail.com wrote: 2012/7/25 Nikita Popov nikita@gmail.com: particular with namespaced code). So if you have some kind of Code\Generator class, you're screwed. Keywords don't grow on trees, you know ;) Hm. Ok, thats a problem. Oh,

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/25 Sara Golemon poll...@php.net: Fact: yield/generators is more or less complicated, this shouldn't be changed - it's a proven concept. Speaking of parse errors, I'm having trouble parsing this line. I *think* you're saying that generators are just complex things and that's the way it

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Rasmus Lerdorf
On 07/25/2012 04:25 PM, Alex Aulbach wrote: In 50 lines of code yield will be just overseen. But I meant something different: I thought of documentation. Maybe someone reads the docs. Really! In the docs he will find functions. And in the function this yield. He dosn't want to know that. It

Re: [PHP-DEV] Generators in PHP

2012-07-25 Thread Alex Aulbach
2012/7/26 Yahav Gindi Bar g.b.ya...@gmail.com: yielder sounds quite weird don't you think (but my native language is not English too.. so don't blame me at english stupid conclusions!) Fact: generator is not a good keyword, because too common. I can't see the connection... people relate the

Re: [PHP-DEV] Generators in PHP

2012-07-25 Thread Stas Malyshev
Hi! The implementation is outlined in the RFC-stub here: https://wiki.php.net/rfc/generators Before going any further I'd like to get some comments about what you think of adding generator support to PHP. Some notes on the RFC: 1. I think we should support rewind() by just creating a new

Re: [PHP-DEV] RFCs and organisation

2012-07-25 Thread Kris Craig
On Wed, Jul 25, 2012 at 1:50 PM, Andrew Faulds a...@ajf.me wrote: Hi there, First off I'd like to apologise for being a generally useless and overly reactive poster on this list. I'm going to exercise more self-constraint now after noticing I made more posts on this list this month than

Re: [PHP-DEV] RFCs and organisation

2012-07-25 Thread Ryan McCue
Andrew Faulds wrote: Secondly, I noticed that Python's PEPs are numbered, unlike PHP's RFCs. Whilst they aren't quite the same thing, I wonder if this would be useful, particularly since it provides a simple and unambiguous way to refer to one, e.g. RFC 123 instead of RFC on how to write an