On 9/11/07, Larry Garfield <[EMAIL PROTECTED]> wrote:
> On Tuesday 11 September 2007, Marcus Boerger wrote:
> > Hello Stanislav,
> >
> > Tuesday, September 11, 2007, 1:21:07 AM, you wrote:
> > > Hi!
> > >
> > > Following the feedback from the community, we (mostly me and Dmitry)
> > > tried to find a good model that would allow multiple namespaces per file
> > > without running into too many problems and complications, and would
> > > allow to bundle multiple namespaced files together without
> > > modifications. It looks like it is possible to do, but only under the
> > > following condition: the file can have multiple namespaces, but if the
> > > file has namespaces, then it can have no code outside namespaces.
> > >
> > > For example, this would work:
> > > namespace A;
> > > class X {}
> > > namespace B;
> > > class Y {}
> >
> > This looks very messy. We should either go with curly braces or with one
> > namespace at the top of a file. And even if we do multiple namespaces per
> > file. I guess we do not allow a naespace to be spread onto several files,
> > right?
>
> From a readability-usability perspective (which is all I am able to offer),
> I'd have to agree with Marcus.  The syntax should follow the structure of the
> parser.  So either:
>
> <?php // One namespace per file only
> namespace Foo;
> class X {}
> function bar() {}
> ?>
>
> or
>
> <?php // Multiple namespaces permitted
> namespace Foo {
>   class X {}
> }
>
> namespace Baz {
>   function bar() {}
> }
>
> I agree that allowing stuff in a file outside of a namespace if namespaces are
> used would be all kinds of confusing with either syntax.
>
> --
> Larry Garfield                  AIM: LOLG42
> [EMAIL PROTECTED]          ICQ: 6817012
>
> "If nature has made any one thing less susceptible than all others of
> exclusive property, it is the action of the thinking power called an idea,
> which an individual may exclusively possess as long as he keeps it to
> himself; but the moment it is divulged, it forces itself into the possession
> of every one, and the receiver cannot dispossess himself of it."  -- Thomas
> Jefferson
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Most of us do agree, but Stas specifically specified that this is not
a { } thread :)

-- 
David Coallier,
Founder & Software Architect,
Agora Production (http://agoraproduction.com)
51.42.06.70.18

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to