Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36526 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9919 invoked from network); 26 Mar 2008 06:11:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Mar 2008 06:11:56 -0000 Authentication-Results: pb1.pair.com header.from=andi@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=andi@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: andi@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:21774] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FB/52-28012-B29E9E74 for ; Wed, 26 Mar 2008 01:11:56 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 26 Mar 2008 08:12:22 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Date: Tue, 25 Mar 2008 23:12:18 -0700 Message-ID: <698DE66518E7CA45812BD18E807866CE016DA77A@us-ex1.zend.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] Re: [RFC] Namespace syntax decision Thread-Index: AciLn1PGElIQpBqIRliEJg/aF0UElADaEnnw References: <1789567073.20080321223647@marcus-boerger.de> <47E43032.20507@chiaraquartet.net> To: "Gregory Beaver" , "Marcus Boerger" Cc: X-OriginalArrivalTime: 26 Mar 2008 06:12:22.0654 (UTC) FILETIME=[5AD5F1E0:01C88F08] Subject: RE: [PHP-DEV] Re: [RFC] Namespace syntax decision From: andi@zend.com ("Andi Gutmans") In general I'd prefer one namespace per-file, at least as a best practice and common advertised use. For this case it doesn't really matter too much whether it's with or without brackets. My preference is without because then you just stick it at the top and don't have an extra level of indentation which you'd typically have with brackets. For the not recommended case where you want to combine multiple files with a tool I still prefer without brackets. The brackets again add indentation and in addition, it's not really clear whether you can put code in between namespaces definitions (between closing "}" and "namespaces" keyword). You shouldn't be able to and without brackets that becomes much more clear because current namespace is relevant until the next namespace declaration; thus never allowing a "gap". I think it's important for people to consider the former reasons as I think without {} will lead be more intuitive and will lead to less indentation. I definitely prefer "namespace" as a keyword. My 2 cents. Andi > -----Original Message----- > From: Gregory Beaver [mailto:greg@chiaraquartet.net] > Sent: Friday, March 21, 2008 3:01 PM > To: Marcus Boerger > Cc: internals@lists.php.net > Subject: [PHP-DEV] Re: [RFC] Namespace syntax decision >=20 > 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 { } >=20 > This is acceptable if nothing can exist outside namespace foo {} except > declare and other namespace declarations. >=20 > > > > 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; >=20 > 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) >=20 > Greg >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php