Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-09 Thread Dmitry Stogov
Jessie Hernandez wrote: I thought global names were considered in the patch, but now that I re-read Dmitry's post, only symbols in the namespace and internal symbols are considered. I read through most of the posts regarding namespaces, but could not find a reason why global names are not l

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-09 Thread Gregory Beaver
Sam Barrow wrote: > I agree with this 100%, is this something that could be changed? I don't > see a reason behind it. > > On Sun, 2007-12-09 at 16:24 -0500, Jessie Hernandez wrote: > >> internal class/function with the same name. >> >> Dmitry, what's the reason this lookup logic wasn't used in

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-09 Thread Sam Barrow
I agree with this 100%, is this something that could be changed? I don't see a reason behind it. On Sun, 2007-12-09 at 16:24 -0500, Jessie Hernandez wrote: > > internal class/function with the same name. > > Dmitry, what's the reason this lookup logic wasn't used in your patch? > -- PHP Inter

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-09 Thread Jessie Hernandez
I thought global names were considered in the patch, but now that I re-read Dmitry's post, only symbols in the namespace and internal symbols are considered. I read through most of the posts regarding namespaces, but could not find a reason why global names are not looked up. Classes/functions

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-08 Thread Gregory Beaver
Jessie Hernandez wrote: > Hi Greg, > > How about this: any non-namespaced file that uses "use" statements is > implicitly put into the __php__ namespace (or whatever other name is > chosen, or having the namespace name be the path of the file)? With > this, "use" will never import any symbols into

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-08 Thread Jessie Hernandez
Hi Greg, How about this: any non-namespaced file that uses "use" statements is implicitly put into the __php__ namespace (or whatever other name is chosen, or having the namespace name be the path of the file)? With this, "use" will never import any symbols into the global namespace. Regard

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-08 Thread Gregory Beaver
Matthias Pigulla wrote: >> Von: Gregory Beaver [mailto:[EMAIL PROTECTED] > >> Exactly - which is why you should never put classes, functions or >> constants in the __php__ namespace. The convention I am proposing >> is to only use __php__ for code that *uses* re-usable components, >> not *declar

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-08 Thread Sam Barrow
In C++, STD was just a normal namespace with some classes and functions in it, you didn't have to say "use std" unless you wanted to use functions in the std namespace. The "php::" namespace could just be a container for all of the functions and classes that are currently thrown into the global na

Re: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-08 Thread Steph Fox
Hi Matthias, Let alone __php__. If you just put all of your code into namespace Mylib, you're not safe because according to the name resolution rules, internal classes come after imported ones but before trying to find classes in the current namespace. I'd missed that :-( and from what I gathe

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Larry Garfield
On Friday 07 December 2007, Gregory Beaver wrote: > > If new, future core extensions showed up in a reserved PHP:: > > namespace, you would be >:-). > > Exactly - which is why you should never put classes, functions or > constants in the __php__ namespace. The convention I am proposing is to > on

AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Matthias Pigulla
> Von: Gregory Beaver [mailto:[EMAIL PROTECTED] > Exactly - which is why you should never put classes, functions or > constants in the __php__ namespace. The convention I am proposing is > to > only use __php__ for code that *uses* re-usable components, not > *declares* them. Let alone __php__.

Re: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Steph Fox
Hi Greg, 1) recommend all global non-namespaced code that wishes to import namespaced code via "use Namespace::Classname" add a "namespace __php__;" at the top of the file, and that the __php__ namespace be reserved for use by end-user applications. That answers my main concern, but I'd make i

RE: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Ford, Mike
On 07 December 2007 17:36, Gregory Beaver wrote: > The suggestion to make "namespace __php__;" implicit is very > interesting, but would defeat its purpose, which is to separate > declarations from use. Oh, I missed that little wrinkle -- I did say I was only skimming! I guess it could still be

Re: AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Gregory Beaver
Matthias Pigulla wrote: >> 1) recommend all global non-namespaced code that wishes to import >> namespaced code via "use Namespace::Classname" add a "namespace >> __php__;" at the top of the file, and that the __php__ namespace be >> reserved for use by end-user applications. > > >> 5) namespa

Re: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Derick Rethans
On Thu, 6 Dec 2007, Gregory Beaver wrote: > I've been thinking a *lot* about your provocative email in the past > couple of days, and have come to a different conclusion from my original > reply (which, as a reminder stated I saw no problem with removing > namespaces as long as we kept the import

Re: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Sam Barrow
I agree with everything here, especially the solution to multiple namespaces per file (allow but discourage), but i don't agree with the __php__ namespace. If any separation of core php and extensions into namespaces happens, it should be kept as simple as possible, with root namespaces like "php::

Re: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Roman Borschel
Great work! +1 from me for your proposals, too! Roman On Dec 7, 2007, at 2:36 AM, Gregory Beaver wrote: Hi Derick, I've been thinking a *lot* about your provocative email in the past couple of days, and have come to a different conclusion from my original reply (which, as a reminder state

RE: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Ford, Mike
On 07 December 2007 01:36, Gregory Beaver wrote: [...snip...] > In other words, 1 line of code is needed to take advantage of > namespace's full protection and ability to import conflicting class > names into the "global" (in this case unqualified, not > containing :: in > the name) scope, while

AW: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-07 Thread Matthias Pigulla
> 1) recommend all global non-namespaced code that wishes to import > namespaced code via "use Namespace::Classname" add a "namespace > __php__;" at the top of the file, and that the __php__ namespace be > reserved for use by end-user applications. > 5) namespaces provide these benefits that are

Re: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-06 Thread Jeremy Privett
Hi Greg, I'm speechless. All of your points are sound and you've obviously done your homework, here. I agree with Ken in that you've gone above and beyond on the research and arguments you've presented here. Excellent work and a hearty +1 to all of your points. Jeremy Gregory Beaver wrote:

RE: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-06 Thread Andi Gutmans
PROTECTED] > Sent: Thursday, December 06, 2007 5:36 PM > To: Derick Rethans > Cc: PHP Developers Mailing List > Subject: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace > > Hi Derick, > > I've been thinking a *lot* about your provocative email in the past > co

Re: [PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-06 Thread Ken Stanley
Holy wow. That was fantastic! Not to downplay anything that Stas and the other developers have done -- because let's face it, they've done a fantastic job themselves -- you have definitely risen above and beyond the call of duty and really come up with some very compelling counter-arguments. This r

[PHP-DEV] A rebuttal to Re: RFC: Dropping Namespace

2007-12-06 Thread Gregory Beaver
Hi Derick, I've been thinking a *lot* about your provocative email in the past couple of days, and have come to a different conclusion from my original reply (which, as a reminder stated I saw no problem with removing namespaces as long as we kept the import facility to alias classes via use). Af