Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:40629 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34272 invoked from network); 23 Sep 2008 10:13:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2008 10:13:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 72.14.220.154 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 72.14.220.154 fg-out-1718.google.com Received: from [72.14.220.154] ([72.14.220.154:29986] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/82-35835-F21C8D84 for ; Tue, 23 Sep 2008 06:13:04 -0400 Received: by fg-out-1718.google.com with SMTP id 16so1831503fgg.23 for ; Tue, 23 Sep 2008 03:13:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=XQ/VYO20CuwVp+KHIL79+AJFZxubJ2Vfl5QlyABttHs=; b=R+zXgNhQ/kINSFo7UQnniMCeUibiPmYf3lRLcUB3pLjjVdes72mZhfeIbafCh2Lbja FRMPAwg+PsB9/yTO0lwUBHU9Or0ZHTZpouyzdmhq9rCdFluR095TbDYOjxnVahMCv2SK fQqbY8RSwFAJruRoqJElzIh337artlgkc/UUI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=O0f1Nbr5p33ZvQfMXcNbZoWXUn/tAPSKeR73V/BcEtwztAcF2bggiIsJ8A3gzc3i21 8FLP5pFcNDe6sw/HURdJNNbPTSVfYp/xwM4mA1nY1J3T03D4fEMwSEkOBBJqOrnrWGKB FsecjFuBZ4w+vgMyhGTJDd84wjIIgs9+D0VE0= Received: by 10.187.250.1 with SMTP id c1mr675345fas.65.1222164780808; Tue, 23 Sep 2008 03:13:00 -0700 (PDT) Received: by 10.187.218.19 with HTTP; Tue, 23 Sep 2008 03:13:00 -0700 (PDT) Message-ID: <2dedb8a0809230313r4a13929eqc19bb12ad6ac5c2d@mail.gmail.com> Date: Tue, 23 Sep 2008 12:13:00 +0200 To: "Karsten Dambekalns" Cc: internals@lists.php.net, "Stanislav Malyshev" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48D7F5EF.3090202@zend.com> Subject: Re: [PHP-DEV] Re: namespace issues From: kalle.php@gmail.com ("Kalle Sommer Nielsen") 2008/9/23 Karsten Dambekalns : > Hi. > > For what it's worth, my point of view: > > Stanislav Malyshev wrote: >> >> 1. Allow braces for namespaces. So, the syntax for namespaces will be: >> a) namespace foo; >> should be first (non-comment) statement in the file, namespace extends to >> the end of the file or next namespace declaration. >> b) namespace foo {} >> can appear anywhere on the top scope (can not be nested). > > Full support for the braces, but please *do*not* allow both ways. Why? > Perl's "more than one way to do it"? If there's one way, it's clear what to > use. I see absolutely no point in this. Really. Please don't. +1, I would however stick with the braces syntax though, why? Because namespaces aren't really anything than something wrapping around a class in my eyes and I don't see why it needs special treatment, if it has to be one per file, then why not classes aswell, this is like PHP is telling how to design my interface, rather than if I want to have a namespace declaring in a file for some reason or if I wanna have all code mixed in one, then I think I should be allowed to do so, and not having to make multiple files, not that its that big an issue but its still a big -1 with a "ns"-only file. (Please exuse if I have missed something, I tried to keep up with the NS threads, but all these new ones has been alittle to much to overcome). > >> 2. Simplify resolution order for classes in the namespace: unqualified >> names are resolved this way: >> a) check "use" list if the name was defined at "use", follow that >> resolution >> b) if not, the name resolves to namespace::name >> Consequence of this will be that for using internal class inside namespace >> one would need to refer to it either as ::Foo or do use ::Foo prior to its >> usage. > > Fine with me. I'd use ::Foo for internal classes anyway to avoid speed and > ambiguity issues. > >> 3. Functions will not be allowed inside namespaces. We arrived to >> conclusion that they are much more trouble than they're worth, and summarily >> we would be better off without them. Most of the functionality could be >> easily achieved using static class methods, and the rest may be emulated >> with variable function names, etc. > > We roll everything in classes anyway, so fine with me. > > > Regards, > Karsten > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > But overall +1 from me aswell -- Kalle Sommer Nielsen