Re: PHP5 and namespaces for PEAR packages.
| From: | Leandro Lucarella | Date: | Fri, 04 Apr 2003 04:51:08 +0000 |
| Subject: | Re: PHP5 and namespaces for PEAR packages. | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14869@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jesus M. Castagnetto, el jueves 3 de abril a las 17:36 me escribiste:
> For example, we could use:
>
> namespace PEAR:Math {
> class Vector {
> ...
> }
> }
>
> or
>
> namespace Math {
> class Vector {
> }
> }
>
> I'd like the first option, because it makes it simpler to have a Math::Vector
> class that is not from PEAR (for example)
I agree.
> Another question. Are we going to keep the '_' naming standard w/ namespaces?,
> i.e. would we use the naming of the class (e.g. in the first example) as
> 'Vector' or 'Math_Vector'?
>
> My instinct would be to use just the shorter form, as the qualification of the
> namespace should suffice, and as we cannot expect a package that has
> namespaces, etc. to run on PHP 4. The second form looks kludgy, e.g.:
>
> $w = new PEAR:Math::Vector(); vs. $w = new PEAR:Math::Math_Vector();
>
> Ideas/opinions/pointers/rants?
I think $w = new PEAR:Math::Vector(); is much better.
- --
LUCA - Leandro Lucarella - Usando Debian GNU/Linux Sid - GNU Generation
- ------------------------------------------------------------------------
E-Mail / JID: luca@lugmen.org.ar
GPG Fingerprint: D9E1 4545 0F4B 7928 E82C 375D 4B02 0FE0 B08B 4FB2
GPG Key: gpg --keyserver pks.lugli.org.ar --recv-keys B08B4FB2
- ------------------------------------------------------------------------
Hey! Come derry dol! Hop along, my hearties!
Hobbits! Ponies all! We are fond of parties.
Now let the fun begin! Let us sing together!
-- J. R. R. Tolkien
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+jQ88SwIP4LCLT7IRAjznAKCfa5KdP8L2Xb6D7ffsIZnouoehBACeOwEQ
XSdyTiJj/grAkmsXn27GN68=
=vnvK
-----END PGP SIGNATURE-----