Re: Re: my last attempt at sanity with namespaces
| From: | Paweł Stradomski | Date: | Fri, 17 Oct 2008 20:20:23 +0000 |
| Subject: | Re: Re: my last attempt at sanity with namespaces | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-41248@lists.php.net to get a copy of this message | ||
W liście Ryan Panning z dnia piątek 17 października 2008:
> Request Autoload Gets Type
> -----------------------------------------------
> A::B:>C A::B:>C Class
> A::B:>func() A::B Namespace
> A::B:>C::CONST A::B:>C Class
> A::B::C:>D::method() A::B::C:>D Class
> A::B::C::D:>CONST A::B::C::D Namespace
I'm just a mere user, but if we go for other namespace separator (be it :::
or :> or anything else), then I'd rather see it used both between namespace
and class/function/constant name *and* between namespace parts. To be clear -
for the examples above I'd rather have them written as:
A:>B:>C
A:>B:>func()
A:>B:>C::CONST
A:>B:>C:>D::method()
or A:::B:::C, A:::B:::func, A:::B:::C::CONST.
That way :: is just operator for static class access (static methods and
properties), while :> or ::: is just namespace access operator, so we can
always assume that anything on the left side of ::: or :> is a namespace. In
Ryan's version :: is sometimes static class access operator, sometimes
namespace segment separator, depending on position.
--
Paweł Stradomski