Re: Simple Namespace Proposal
| From: | david dot coallier at nyphp dot com | Date: | Sun, 15 Jul 2007 12:56:30 +0000 |
| Subject: | Re: Simple Namespace Proposal | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-30948@lists.php.net to get a copy of this message | ||
Good stuff
On 7/15/07, Dmitry Stogov <dmitry@zend.com> wrote:
The patch is already committed to the HEAD. Dmitry. -----Original Message----- From: Hans Lellelid [mailto:hlellelid@php.net] Sent: Sunday, July 15, 2007 4:37 AM Cc: Dmitry Stogov; 'PHP internals' Subject: Re: [PHP-DEV] Simple Namespace Proposal As someone that has long clamoured for namespaces in PHP, I have to say that this proposal by Dmitry is exactly what I & others have been hoping for in PHP. Thanks, Dmitry, for creating this patch. I'm sure there are going to be some peculiarities that need to be sorted out, but I can't wait until we can start writing code to use this! I am confidentl that this is something that will be embraced by the OOP PHP community as soon as it is available. Hans Andrei Zmievski wrote:-- David Coallier, Founder & Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18I love this. Let's ship it. -Andrei On Jul 5, 2007, at 6:49 AM, Dmitry Stogov wrote:not sureI think the following example is much better, however I amnames thatit's a right direction. Namespaces are intended to declarenamespace), do I amcan conflict with names from other namespaces (including globaland idea.not sure that we need special keyword for internal functions. We'll think little bit more. Anyway thank you for feedback[mailto:david.coallier@gmail.com] On<?php namespace UTF8; overloaded class Exception { } overloaded function strlen() { } ?> Thanks. Dmitry.-----Original Message----- From: david.coallier@gmail.comexception)Behalf Of David Coallier Sent: Thursday, July 05, 2007 5:35 PM To: Stefan Priebsch Cc: Dmitry Stogov; PHP internals Subject: Re: [PHP-DEV] Simple Namespace Proposal On 7/5/07, Stefan Priebsch <stefan.priebsch@e-novative.de> wrote:David Coallier schrieb:warning whenI would probably be in favor of throwing a notice or asomeone modifies a built-in function (or even throw anfoo()" orright awayand that way as soon as you do such thing you would knowfor peoplethat you modified something and you would know where the modification happened which would make things much easierfeature asdeveloping and debugging applications.The problem is that this kind of overloading makes a nicewell. This is runied by throwing an exception, and cautiousdeveloperswill at least get nervous when they see a notice. I could imagine that by adding something like "overridesfunction, and if"overloads foo()" to a function/method declaration thedeveloper couldmake clear that he willingly overrides a built-inbe a littlethis is missing, an exception is being thrown. This mayexample ! } ...over the top, however.Yep I see what you mean.. could even be something like: namespace UTF8; overrides {strlen(); strcmp();} function strlen($string) {return strlen($string) + 666; // This is just an-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpI kinda like the overrides part, however I wonder if people will actually use it.. Oh well.. my two cents are now gone.-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpKind regards, Stefan ---- David Coallier, Founder & Software Architect, Agora Production (http://agoraproduction.com) 51.42.06.70.18 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.phpe-novative> - We make IT work for you.e-novative GmbH - HR: Amtsgericht München HRB 139407 Sitz: Wolfratshausen - GF: Dipl. Inform. Stefan Priebsch http://www.e-novative.de