Re: [RFC] Namespace syntax decision

From: Date: Fri, 21 Mar 2008 22:01:22 +0000
Subject: Re: [RFC] Namespace syntax decision
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-36302@lists.php.net to get a copy of this message
Marcus Boerger wrote: > Hello Internals, > > we all were asked to stop discussing syntax of namespaces as we were told > that we would decide after the namespace functionality was fully implemented. > Now I think that the functionallity is pretty much settled we should > revisit the syntax. We all have been very patient so far. Anyway here goes > my take on it: > > PHP is very close to Java and C++ in terms of Syntax. And many of our users > are familiar with one or even both of them. Also we have a tendency to > especially take syntax from those two or be in line with those two > languages. That said I see two ways: > > 1) namespace foo { } This is acceptable if nothing can exist outside namespace foo {} except declare and other namespace declarations. > > 2) package foo; > > I favor 1) if we allow namespace nesting and 2) if not. The current way of > nesting is very confusing: > namespace foo; namespace bar; I prefer this syntax because it discourages multiple namespaces, but still allows them (nesting is an inaccurate term in this case, I strongly encourage not using it) Greg

« previous php.internals (#36302) next »