Re: Question about Namespace patch

From: Date: Tue, 24 Jul 2007 13:09:31 +0000
Subject: Re: Question about Namespace patch
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-31238@lists.php.net to get a copy of this message
Rasmus Lerdorf wrote:
Stanislav Malyshev wrote:
Compile-time resolution means you don't get performance penalty for namespaces when you are not using it, and have very low costs when you do use it. Allowing blanket imports means we don't know what "new Foo()" means until it is executed - meaning we need to make extra lookups on each class fetch, even if the code doesn't use namespaces at all. That's only one problem with blanket imports.
    
And a fatal one in my book. For the folks arguing so passionately about this namespace implementation, try to consider the compiler vs. executor issues involved. We really need to stop the trend of pushing everything down into the executor. -Rasmus The compile time vs. execution time argument may be a good one against global import and against other crazy ideas in my head (like allowing statements in namespaces).
But why not allow importing namespaced functions and constants into the global namespace? If this were added then "blanket import" could be left to the intrepid and foolhardy programmer to do manually. It'd just end up being boilerplate and if someone really objects to some extra lines they could add an explicit fold in their editor to hide it.

« previous php.internals (#31238) next »