RE: [PHP-DEV] [PATCH] allowing multiple namespaces per file plus namespaces with brackets
| From: | Dmitry Stogov | Date: | Tue, 21 Aug 2007 13:28:11 +0000 |
| Subject: | RE: [PHP-DEV] [PATCH] allowing multiple namespaces per file plus namespaces with brackets | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-31787@lists.php.net to get a copy of this message | ||
Marcus,
You can laugh as you like.
I never said that I didn't like rename "namespace" to "package".
I asked to wait with decision because the whole concept is not finalized
yet.
For example "packages" and "multiple namespaces in single file" are
inconsistent.
Anyway, I prefer developing PHP than argue with your unconstructive emails.
Thanks. Dmitry.
> -----Original Message-----
> From: Marcus Boerger [mailto:helly@php.net]
> Sent: Tuesday, August 21, 2007 2:24 PM
> To: Dmitry Stogov
> Cc: 'Gregory Beaver'; 'internals Mailing List'; 'Stanislav
> Malyshev'
> Subject: Re: [PHP-DEV] [PATCH] allowing multiple namespaces
> per file plus namespaces with brackets
>
>
> Hello Dmitry,
>
> LOL!!!!!
>
> climbing up the chair again, this is the most stupiest arguemnt ever.
>
> didn't you just yesterday suggest we keep it namespace anyway
> until we are done. And didn't you guys say that we might end
> up with something that really is namespaces anyway.
>
> Please guyse read your own arguments if you do not manage to
> remember them.
>
> marcus
>
> Tuesday, August 21, 2007, 10:16:39 AM, you wrote:
>
> > How about "import" statements?
> > The had effect on current file. How they will behave with
> your patch?
> > The import in one namespace will affect following namespaces... :)
>
> > Also this change is inconsistent with renaming "namespace" to
> > "package".
>
> > Thanks. Dmitry.
>
>
> >> -----Original Message-----
> >> From: Gregory Beaver [mailto:greg@chiaraquartet.net]
> >> Sent: Monday, August 20, 2007 11:57 PM
> >> To: internals Mailing List; Dmitry Stogov; Stanislav Malyshev
> >> Subject: [PHP-DEV] [PATCH] allowing multiple namespaces per
> >> file plus namespaces with brackets
> >>
> >>
> >> Hi all,
> >>
> >> This patch is also available at
> >> http://pear.php.net/~greg/namespace.patch.txt
> >>
> >> The patch adds the syntax "namespace { *stuff }" and allows
> >> multiple namespaces per file with no performance penalty or
> >> added complexity as only 4 lines of code need to be changed,
> >> and 9 lines of code added to implement this support!
> >>
> >> Basically, there is one use case of multiple namespaces per
> >> file that the patch is designed to support, which is the
> >> ability to cram many files into a single file. I have done
> >> this for purposes of distributing things (prior to phar), it
> >> is used by some with phing tasks for performance reasons, and
> >> can have other uses as well.
> >>
> >> The patch provides the ability to do this, for example:
> >>
> >> <?php
> >> namespace One {
> >> require_once 'blah.php';
> >> class MyClass extends blah
> >> {
> >> function test()
> >> {
> >> echo "OK\n";
> >> }
> >> }
> >> function test()
> >> {
> >> echo "OK\n";
> >> }
> >> }
> >>
> >> namespace Two {
> >> class MyClass
> >> {
> >> function test()
> >> {
> >> echo "OK\n";
> >> }
> >> }
> >> function test()
> >> {
> >> echo "OK\n";
> >> }
> >> }
> >> ?>
> >>
> >> Note that the old format "namespace OneRingToRuleThemAll;" is
> >> still fully supported, and should be the recommended format,
> >> as build tools can easily take an entire file, change
> >> namespace .*; into namespace .*{ and append <?php } ?> to the
> >> end of the file.
> >>
> >> The attached patch is against php6, but as you can see, a
> >> blind monkey could port it to PHP_5_3 when the time comes.
> >> All of the introduced changes are now tested, including the
> >> error message for nested namespace declarations, and the
> >> error message for multiple namespace declarations with ;
> >> (which was previously untested by .phpt tests)
> >>
> >> Thanks,
> >> Greg
> >>
>
>
>
>
> Best regards,
> Marcus
>