Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33959 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30142 invoked by uid 1010); 12 Dec 2007 04:34:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30126 invoked from network); 12 Dec 2007 04:34:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Dec 2007 04:34:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:32945] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/5D-38526-9B46F574 for ; Tue, 11 Dec 2007 23:34:02 -0500 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id D3B2BC0F148; Tue, 11 Dec 2007 21:33:58 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-15-179.neb.res.rr.com [76.84.15.179]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 74FEAC0F13D; Tue, 11 Dec 2007 21:33:58 -0700 (MST) Message-ID: <475F64B5.7010100@chiaraquartet.net> Date: Tue, 11 Dec 2007 22:33:57 -0600 User-Agent: Thunderbird 2.0.0.6 (X11/20071022) MIME-Version: 1.0 To: Ken Stanley CC: internals Mailing List References: <475F1984.603@chiaraquartet.net> In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [PHP-DEV] namespace improvements to be committed very soon - final review From: greg@chiaraquartet.net (Gregory Beaver) Ken Stanley wrote: > > > On Dec 11, 2007 6:13 PM, Gregory Beaver > wrote: > > The example above shows that imported names are reset at each > namespace > declaration. There is no prohibition on this code: > > namespace one; { > use Blah::A; > // code > } > namespace two; { > use Foo::A; > // code > } > ?> > > Users who wish to use brackets may do so. The performance penalty > imposed by using brackets is minor for some cases, and for users > who are > following the recommended practice of 1 namespace per file, the > syntax > is ideal. > > My question is that if using the above code already incurs a perf > penalty, then why not just go ahead and include true support for > braces in namespaces. Unless there is an additional penalty that I'm > missing, the only difference between true braces and the above is that > the above looks like a cheap hack (note: the use the of phrase "cheap > hack" is in no way meant to demean the hard work of the people > involved with the namespace implementation, and is the sole opinion of > the poster :)). Because the performance penalty is unnecessary, just use 1 namespace per file for your code. Those who need to combine files are not doing it for maintenance reasons. Just to be clear, this code does *not* have a performance penalty: Any brackets adds another set of shift/reduce to the parser, regardless of how the syntax of the language is defined. Greg