Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:30988 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30370 invoked by uid 1010); 16 Jul 2007 17:32:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30355 invoked from network); 16 Jul 2007 17:32:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2007 17:32:04 -0000 Authentication-Results: pb1.pair.com smtp.mail=d.giedrius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=d.giedrius@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.146.179 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: d.giedrius@gmail.com X-Host-Fingerprint: 209.85.146.179 wa-out-1112.google.com Received: from [209.85.146.179] ([209.85.146.179:20476] helo=wa-out-1112.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/36-09703-68BAB964 for ; Mon, 16 Jul 2007 13:32:00 -0400 Received: by wa-out-1112.google.com with SMTP id l24so1778264waf for ; Mon, 16 Jul 2007 10:31:03 -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:content-transfer-encoding:content-disposition:references; b=UI6+aUaKoddXO9EK+tSM9Y57eQBjo/mD2oINrfNOXDO5X1MV4NI0QBHkDJuV/mKC736glVAXyqPHZXkmAtirG2S1Fijm7VO6Pax/fXCVm/yzF6bfMMsy/4fMQTg0KdDs4Z6VD9BZNnb/8CRSklkdOut/Rkj0EDSJxjAf3Sm13bA= 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:content-transfer-encoding:content-disposition:references; b=KoI+SuO39+u0FHwHxbsc+AfelxqLpK6rSc20RLunX9YQHT3s524Nvo/XZiB/G9a7LG8fPyKLx4jmAV6Q2wRD6K1pPxQh4bowj/LrSFe9MCWWhGhvejP5wfclj0OSShL+fJXzwWnyU40mWd+yQ9tA8WMVQ78vnyPEX67yCI5lgtQ= Received: by 10.114.80.4 with SMTP id d4mr4343061wab.1184607063553; Mon, 16 Jul 2007 10:31:03 -0700 (PDT) Received: by 10.114.144.12 with HTTP; Mon, 16 Jul 2007 10:31:03 -0700 (PDT) Message-ID: <3d1a63d10707161031w41a38013wda2a40ce21c25969@mail.gmail.com> Date: Mon, 16 Jul 2007 20:31:03 +0300 To: "Stanislav Malyshev" Cc: internals@lists.php.net In-Reply-To: <469B9E12.7050104@zend.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3d1a63d10707150624y2b166f33y1bf3f628aba596b2@mail.gmail.com> <469AD3F8.40109@zend.com> <3d1a63d10707160001p64eff2fdy3fa1707679a5d05b@mail.gmail.com> <469B9E12.7050104@zend.com> Subject: Re: [PHP-DEV] Simple Namespace Proposal From: d.giedrius@gmail.com ("Giedrius D") On 7/16/07, Stanislav Malyshev wrote: > > a) I was talking about namespace name "A_B" not class/function name. > > _ is legal identifier character, so it would not be a good idea to use > it as a separator. :: on the other side is natural scope separator in > many languages. But I'm rather reluctant to start the "my separator is > better than yours" thread for the 42th time :) Me neither :-) :: is perfectly good for me. I just missed the point of having it more then once if it's only purpose is to separate default short name part from whole name. > > b) So as far as I understand "import" doesn't actually *import* names > > from specified > > namespace to the current one but just renames long namespace name to a > > shorter one. And if I get it right the separator in the namespace name > > is allowed > > and required only to express default name when importing without "as". > > Am I right? > > Not exactly. It does import, but not names just one name - the very same > name it has as an argument. The :: is used to join components of the > name. Note that you can also do: > > import Foo::XML as myXML; > $a = new myXML::Data::Document(); Now that explains a lot :-) If I get it right I can have namespaces A::B::C and A::B::D then create an alias for A::B with "import A::B" and use B::C::foo() and B::D::foo() in that file. Thats nice. Looks like namespace nesting though it isn't :-) Regards, Giedrius