Re: kick-off
| From: | Stig Bakken | Date: | Tue, 29 Feb 2000 13:10:50 +0000 |
| Subject: | Re: kick-off | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-38@lists.php.net to get a copy of this message | ||
Andi Gutmans wrote:
>
> I think allowing functions is a good idea. They are also faster.
> Think of the numerous libC functions, similar functions might end up in PEAR.
> I think functions should have a prefix based on the name of their package.
This gives me the chance to advocate namespaces again Andi. :-) IMHO
that would be a cleaner solution than wrapping everything in classes and
definitely cleaner than using prefixes. Less typing too. Namespaces in
PHP would allow us to define namespaces based on PEAR package names and
let packages define functions without prefixes. Prefixes do get
tedious, as does the class name if using the Class::method() approach.
Suggested changes for namespace support:
1. Remove "import" as it is today, and make "use" able to detect whether
it is used with a constant or non-constant parameter (like require).
2. Add a "package" statement that lets you switch symbol table per-file
(I think you mentioned that there were problems doing it per-file at the
PDM?)
3. Re-introduce the "import" statement, but now it makes references from
another namespace into the current one, as a more generic version of
"global".
- Stig