Re: [Fwd: Re: [PHP-DEV] Renaming namespaces to packages]

From: Date: Wed, 15 Aug 2007 20:52:54 +0000
Subject: Re: [Fwd: Re: [PHP-DEV] Renaming namespaces to packages]
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-31598@lists.php.net to get a copy of this message
On 8/15/07, Stanislav Malyshev <stas@zend.com> wrote: > > current implementation doesn't have braces; this (consequently) adds a > > Ouch, not braces again. What is it with braces that you need them so > badly? Many languages aren't using the things ever, isn't it a proof > that there's life outside braces? ;) > Well.. My guess is that If current implementation had braces all this namespace/package thing wouldn't be even discussed now. Everyone would agree that it's namespace thing even if one must put all file contents inside braces for parser to be happy. However without braces current implementation looks like nothing else in PHP. This gives people a space to improvise and/or pushes to look for similarities of syntax in other languages and it seems that the closest match is Java with its packages even though the functionality is different. I don't want to start braces discussion again but may suggest consider adding them? Pros: - It would end this discussion - It would be good for FC. If there would be decided to allow more then one namespace per file in the future. - Syntax would be more consistent with existing constructs in the language (classes/functions/etc) To sum up I think we have namespaces functionality with syntax similar to Java packages. Now the question is do we want developers to: - use namespaces anr/or mimic packages functionality with "namespace" if they want to (+1 for namespace) OR - use "package" the way it shouldn't be to mimic simple namespaces if they don't like/want/need packages (+1 for package) Regards, Giedrius

« previous php.internals (#31598) next »