Re: ZendEngine2/RFCs/002.txt
| From: | (Stig Sæther Bakken) | Date: | Sat, 08 Sep 2001 16:56:18 +0000 |
| Subject: | Re: ZendEngine2/RFCs/002.txt | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1850@lists.php.net to get a copy of this message | ||
[Andrei Zmievski <andrei@ispi.net>]
> On Sat, 08 Sep 2001, Stig Sæther Bakken wrote:
> > 1. Allow mid-file namespaces changes that would allow a file to
> > contain:
> >
> > namespace Foo;
> > class Bar ...
> > namespace Foo:Bar;
> > constants ...
>
> That's not too bad.
>
> > 2. Change the entire PEAR class<->file scheme to a class<->namespace
> > scheme. This would be pretty ugly, we'd end up with fully
> > qualified class names such as "HTML_Table:Table" or
> > "HTML:Table:Table".
>
> Ack.
>
> > 3. Make a namespace "instantiatable" like I suggested a month or two
> > ago. This is what Perl/CPAN ended up doing, probably for the same
> > reasons I'm losing hair over this. :-)
>
> What's an instantiable namespace?
You can basically regard the "namespace" statement as a class
declaration, the functions following it are class methods, the
variables are class variables. The constants are just namespaced
constants. When Zend is done parsing the file, it has built a class
definition just like it would with "class". Then you can instantiate
the "namespace class".
There are some problems with this, but I'm not in a position to tell
if it'd be impossible to do in ZE2. :-)
- Stig
--
Stig Sæther Bakken <ssb@alltheweb.com>
Fast Search & Transfer ASA, Trondheim, Norway