Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31677 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66422 invoked by uid 1010); 17 Aug 2007 12:45:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66407 invoked from network); 17 Aug 2007 12:45:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2007 12:45:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=diogin@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=diogin@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.162.236 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: diogin@gmail.com X-Host-Fingerprint: 64.233.162.236 nz-out-0506.google.com Received: from [64.233.162.236] ([64.233.162.236:8884] helo=nz-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/C6-28909-48895C64 for ; Fri, 17 Aug 2007 08:45:56 -0400 Received: by nz-out-0506.google.com with SMTP id x7so218748nzc for ; Fri, 17 Aug 2007 05:45:54 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Y25qiwSwn0/Yc9u/zVbw5MAop0gXkOcaXhSEp0JnHNem7b9gF5W3gBGFVNBMvoiR1HA081xR8uJO223gupcJouy3zPUmVdvQNFbBx45kZqakAuU8RX90C6JMXABja3nEjH74L97IGJmBOvMnaPczWp48iZ/lkhua23UduQj9HXg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=OPSVUN6/v3juVcTgEcai3BPi5k2qUiuouYQxCTFjHqjEUhhnqbBTJ1b+dN8tz5nZMtQ+iYtB5lREng4KfS15gh0kieLWoh1dMAsB0hF8jFOGC99kVPI2QoCIVNisMkcX7qafE6EjXowpW0zdkyUYRRfAQgWAj59RKTAjTeCbCIs= Received: by 10.142.185.13 with SMTP id i13mr177855wff.1187354753272; Fri, 17 Aug 2007 05:45:53 -0700 (PDT) Received: by 10.143.45.6 with HTTP; Fri, 17 Aug 2007 05:45:53 -0700 (PDT) Message-ID: Date: Fri, 17 Aug 2007 20:45:53 +0800 To: "M. Sokolewicz" Cc: internals@lists.php.net In-Reply-To: <26.B4.34488.EC285C64@pb1.pair.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_126278_31923027.1187354753229" References: <46BE14B1.5050209@zend.com> <46C3F4C4.5080008@zend.com> <46C3F7D0.9010904@zend.com> <46C3FB3C.50104@zend.com> <46C4777D.6010003@chiaraquartet.net> <26.B4.34488.EC285C64@pb1.pair.com> Subject: Re: [Fwd: Re: [PHP-DEV] Renaming namespaces to packages] From: diogin@gmail.com ("Jingcheng Zhang") ------=_Part_126278_31923027.1187354753229 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Has anyone thought of the keyword "phpspace"? 2007/8/17, M. Sokolewicz : > > I've been reading this lengthy discussion and here's a sumup of what I > found: > - PHP's implementation is only a part of what most people expect to find > when they hear "php has namespace support" > - PHP's implementation looks a bit like JAVA's package support, and a > bit like many other (differently names) features in other languages. It > however does not match 1:1 to any of those. > > So, everyone here has agreed already that "namespaces" !=== PHP's > implementation (it might ==, but not ===). Same goes for Package. > I find the idea of Greg to be very good though, reading the original > proposal, it often names things not "namespace" but simply "prefix". > What do you do with your names? you use a prefix, you don't expect it to > have "full namespace support just like [insert any other language > here]", nor do you expect it to "be exactly like a JAVA package". > > When announced, you could simply state "PHP now has support for > prefixing, PHP's own specific implementation of namespaces". Because > that's what you have, you can complain that "according to the definition > of [word] it _is_ that.", but you can't really. The "definition" of a > word like namespace, package, etc. is not independent of its > implementation in majorly used languages unfortunately. If you ask a > random coder "what is a namespace", the answer will always be based on > an implementation in a language the person uses/likes a lot. You can > quote from wikipedia, but that doesn't really mean anything (sorry > Stas), what we should try to do here is find the proper name which > identifies the implementation we have for what it is. > > prefix Foo; > alias Foo:Bar as Quux; > > Looks very good to me as it clearly shows what happens, internally and > externally. It's not a namespace as such, it's not a package as such, > it's simply what PHP _does_. > > I hope this will help the discussion steer away from the standard > arguments that have been used constantly, and that will simply not change. > > - Tul > > Gregory Beaver wrote: > > Hi, > > > > All of the debate over whether this is a true namespace implementation > > is in my opinion completely bogus (translate: I think "namespace" is a > > fine choice for the reserved word, and "package" is a dangerously > > misleading choice), but since there is so much noisy dissent, I have an > > alternative proposal I'd like to float: > > > > How about using the keyword "prefix" or "nameprefix" instead of > > "namespace"? This will be clearer and can be easily defined with 2 > > sentences similar to the original proposal: "All class and function > > names inside the file are automatically prefixed with the > > (prefix|nameprefix) name. In other files, classes and functions can be > > imported with different names (aliases) to eliminate naming conflicts or > > reduce typing needed." > > > > I quote from the original "Simple Namespace Proposal" message by Dmitry: > > > > From the beginning: > >> Main assumption of the model is that the problem that we are to solve > is the > >> problem of the very long class names in PHP libraries. We would not > attempt > >> to take autoloader's job or create packaging model - only make names > >> manageable. > > > > From the middle: > >> Namespace definition does the following: > >> All class and function names inside are automatically prefixed with > >> namespace name. > > > > As stated, because this proposal *only* defines a prefix for functions > > and class names, it is not a packaging model. All package models in > > existence define some kind of self-contained entity that groups related > > *files* and their contents together in a way that allows them to be > > "packaged" into a single thing, like a jar, a PEAR .tgz, or a .phar > > file. This proposal does none of these things. Simply because the > > prefix is defined per-file does not a package make. By the same logic, > > using ".php" at the end of a file or ".dat" at the end of a file creates > > special packages of php or dat information, because the extension > > applies to the whole file at once. Simply defining the contents of a > > file does not imply any organization whatsoever. > > > > What the original proposal *does* do is provide a namespace prefix - it > > defines a scope within which all names have a special prefix. This is > > not rocket science. > > > > On a personal note, if you feel you must reply to this thread > > further, please follow this checklist: > > > > 1) is anything I am saying bring a new idea to the debate? > > 2) is there a patch that converts my new idea into a reality attached to > > the message? > > > > If you can't answer "yes" to either of these, please go immediately to > > jail, do not pass go, do not collect $200. > > > > Thank you to Dmitry for this much-needed idea. > > > > Thanks, > > Greg > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Best regards, Jingcheng Zhang Room 304, Dormitory 26 of Yuquan Campus, Zhejiang University P.R.China ------=_Part_126278_31923027.1187354753229--