Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36527 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12305 invoked from network); 26 Mar 2008 06:35:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Mar 2008 06:35:46 -0000 Authentication-Results: pb1.pair.com smtp.mail=paulchandler3@mac.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=paulchandler3@mac.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mac.com from 17.148.16.72 cause and error) X-PHP-List-Original-Sender: paulchandler3@mac.com X-Host-Fingerprint: 17.148.16.72 smtpoutm.mac.com FreeBSD 4.7-5.2 (or MacOS X 10.2-10.3) (1) Received: from [17.148.16.72] ([17.148.16.72:63828] helo=smtpoutm.mac.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/C2-28012-0CEE9E74 for ; Wed, 26 Mar 2008 01:35:46 -0500 Received: from mac.com (asmtp010-s [10.150.69.73]) by smtpoutm.mac.com (Xserve/smtpout009/MantshX 4.0) with ESMTP id m2Q6Zfaa029306; Tue, 25 Mar 2008 23:35:41 -0700 (PDT) Received: from [192.168.1.102] (ip72-207-37-149.sd.sd.cox.net [72.207.37.149]) (authenticated bits=0) by mac.com (Xserve/asmtp010/MantshX 4.0) with ESMTP id m2Q6ZdZf019474 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 25 Mar 2008 23:35:39 -0700 (PDT) Cc: Gregory Beaver , Marcus Boerger , internals@lists.php.net Message-ID: <4A831EBC-1505-4E18-8806-4231F54FF1D7@mac.com> To: Andi Gutmans In-Reply-To: <698DE66518E7CA45812BD18E807866CE016DA77A@us-ex1.zend.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v919.2) Date: Tue, 25 Mar 2008 23:35:39 -0700 References: <1789567073.20080321223647@marcus-boerger.de> <47E43032.20507@chiaraquartet.net> <698DE66518E7CA45812BD18E807866CE016DA77A@us-ex1.zend.net> X-Mailer: Apple Mail (2.919.2) Subject: Re: [PHP-DEV] Re: [RFC] Namespace syntax decision From: paulchandler3@mac.com (Paul Chandler) Can't both (brackets and non) be supported? I have some sick people in =20= my own company that would LOVE if they could embed multiple namespaces =20= in the same file. In circles around my own cub=10icle, engineers prefer =20= to write one class per namespace, per file, as God intended. Various =20 Perl, Python & C influences have made some developers think =20 differently about code separation. Can "namespace" exist as both a statement and a bracketed keyword? =20 Obviously, the documentation should encourage best practices, so =20 proper separation would be a primary topic... but accommodation for my =20= "alternative" engineers would also be available. p On Mar 25, 2008, at 11:12 PM, Andi Gutmans wrote: > 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 =20= > 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 =20 > 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 >> >> 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 >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >