Re: [PHP-DEV] nested namespace

2003-03-07 Thread Greg Beaver


Derick Rethans wrote:
On Fri, 7 Mar 2003, Greg Beaver wrote:


namespace Package {
const one = 1;
   namespace SubPackage {
   const one = 'one';
   }
}


You can not nest namespaces, so this wont work.

Derick

OK, makes sense.  Adding this sentence would clear up a great deal of 
confusion.

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


Re: [PHP-DEV] nested namespace

2003-03-07 Thread Derick Rethans
On Fri, 7 Mar 2003, Greg Beaver wrote:

> namespace Package {
> const one = 1;
> namespace SubPackage {
> const one = 'one';
> }
> }

You can not nest namespaces, so this wont work.

Derick

-- 
Stop mad cowboy disease!
-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-

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



[PHP-DEV] nested namespace

2003-03-07 Thread Greg Beaver
Hi,

I'm wondering if a note of clarification could be added to ZEND_CHANGES. 
 The sentences:

A namespace's name may contain colons to denote "sub-namespaces".
This is pure syntactic sugar, the Zend Engine will not see, for
instance, the namespaces "Package", "Package:Subpackage" and
"Package:Subpackage:Subsubpackage" as related.
will possibly be clearer if modified like:

A namespace's name may contain SINGLE colons (:) to denote 
"sub-namespaces".  This is pure syntactic sugar, the Zend Engine
will not see, for instance, the namespaces "Package", 
"Package:Subpackage" and "Package:Subpackage:Subsubpackage" as related.
DOUBLE colons are used to distinguish between nested namespaces as in 
"Package::Subpackage."  A namespace identifier may not begin with a colon.

namespace Package {
const one = 1;
   namespace SubPackage {
   const one = 'one';
   }
}
namespace Package:Subpackage {
const one = 'einz';
}
echo Package::one; // 1
echo Package::Subpackage::one; // one
echo Package:Subpackage::one // einz
This is assuming I understand namespaces.  Modify as needed.

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