Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31630 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56820 invoked by uid 1010); 16 Aug 2007 16:13:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 56802 invoked from network); 16 Aug 2007 16:12:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2007 16:12:59 -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:38998] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/15-22320-D0774C64 for ; Thu, 16 Aug 2007 12:10:59 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id C262CC0D9FB; Thu, 16 Aug 2007 09:10:43 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-1-170.neb.res.rr.com [76.84.1.170]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 787CDC0D9F9; Thu, 16 Aug 2007 09:10:42 -0700 (MST) Message-ID: <46C4777D.6010003@chiaraquartet.net> Date: Thu, 16 Aug 2007 11:12:45 -0500 User-Agent: Thunderbird 1.5.0.12 (X11/20070604) MIME-Version: 1.0 To: Dmitry Stogov CC: Stanislav Malyshev , internals@lists.php.net References: <46BE14B1.5050209@zend.com> <6094eac50708150709o6d1fe42bx3449af2bc1b7f54d@mail.gmail.com> <46C337F4.5080001@zend.com> <46C3F4C4.5080008@zend.com> <46C3F7D0.9010904@zend.com> <46C3FB3C.50104@zend.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: Re: [Fwd: Re: [PHP-DEV] Renaming namespaces to packages] From: greg@chiaraquartet.net (Gregory Beaver) 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