Question on namespaces

php.internals

Marcus Börger

19 years ago
Hello Dmitry, all, thanks for the namespaces. My only concern is that you took a package model and named it namespaces. Can we change the keyword from 'namespace' to 'package'? Best regards, Marcus

Stanislav Malyshev

19 years ago
> My only concern is that you took a package model and named it namespaces. > Can we change the keyword from 'namespace' to 'package'?
Actually, it's neither, but it's more like namespaces than packages IMHO. Though both terms are used in different languages in the roughly same sense.
-- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

Marcus Börger

19 years ago
Hello Stanislav, I use a broad variety of languages. And the older ones like C++ and Java are pretty distinctive. Namespaces have a dedicated range or space declared by curly braces and can contain other namespaces. Whileas Java packages are file wide. And actually that is much easier and quite what we want. We want this connection from a file to a namespace erm making a file giving a name prefix automatically. We do not want the confusion namespaces in the C++ sense can bring. So yes I like the implementation Dmitry did a lot - it just seems wrong to me calling them namespaces purely because we called them that prior to 5.0 release and becasue we always called them so in discussions. But the implementation is also quite different from anything we discussed outside of the paris meeting. That's all from my side. marcus Wednesday, July 25, 2007, 2:04:07 AM, you wrote:
>> My only concern is that you took a package model and named it namespaces. >> Can we change the keyword from 'namespace' to 'package'?
> Actually, it's neither, but it's more like namespaces than packages > IMHO. Though both terms are used in different languages in the roughly > same sense.
Best regards, Marcus

Dmitry Stogov

19 years ago
Different languages have different 'package' model too. For example Java, Ada and Python have packages, but they are too different. BTW PHP's implementation is similar to Java packages and may be you are right about renaming. Thanks. Dmitry.

Sebastian Bergmann

19 years ago
Marcus Boerger wrote:
> Can we change the keyword from 'namespace' to 'package'?
I second that (e)motion. The current implementation of namespaces in PHP is so close to Java's packages that naming it packages makes (more) sense to me.
-- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69

Richard Lynch

19 years ago
On Wed, July 25, 2007 2:34 am, Sebastian Bergmann wrote:
> Marcus Boerger wrote: >> Can we change the keyword from 'namespace' to 'package'? > > I second that (e)motion. The current implementation of namespaces in > PHP > is so close to Java's packages that naming it packages makes (more) > sense to me.
It does smell more like a package to this user... Though I'm more familiar with Modula-2 and [mumble] from 20 years ago the last time I tried to use packages. Oh, and Lisp and Lisp-derivatives, but I'm not sure that even applies for comparison purposes.
-- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

Cristian Rodriguez

19 years ago
On 7/25/07, Sebastian Bergmann <sb@sebastian-bergmann.de> wrote:
> Marcus Boerger wrote: > > Can we change the keyword from 'namespace' to 'package'? > > I second that (e)motion. The current implementation of namespaces in PHP > is so close to Java's packages that naming it packages makes (more) > sense to me.
Yes, that makes more sense ;-) +1