Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:20840 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65331 invoked by uid 1010); 29 Nov 2005 16:28:59 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65316 invoked from network); 29 Nov 2005 16:28:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2005 16:28:59 -0000 X-Host-Fingerprint: 194.109.253.196 mediawave.xs4all.nl Received: from ([194.109.253.196:9843] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 93/24-14828-BC18C834 for ; Tue, 29 Nov 2005 11:28:59 -0500 Message-ID: <93.24.14828.BC18C834@pb1.pair.com> To: internals@lists.php.net Date: Tue, 29 Nov 2005 17:29:36 +0100 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 References: <00A2E2156BEE8446A81C8881AE117F192C1D5D@companyweb> <86.C0.14828.AB57C834@pb1.pair.com> In-Reply-To: <86.C0.14828.AB57C834@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 194.109.253.196 Subject: Re: [PHP-DEV] Basic Namespace Requirements From: bart@mediawave.nl (Bart de Boer) I'm not sure I understand this problem. Isn't it doable to define defines at runtime and then put them under a certain namespace? I'm assuming namespaces are defined before defines? Ideally, I'd say there should be no code limitations inside namespaces. But if this poses technical problems. Then I think using only classes under namespaces is better then no namespaces. Jessie Hernandez wrote: > Matthias, > > Simply put, const != define. Like I think Sara mentioned before, defines are > runtime-defined, and making it both compile-time/runtime defined based on > context will be really confusing. > > Also, I'm not accepting variables in namespaces and this is not needed > either. So, yes, this is outside the scope of what I want to accomplish. > > > Regards, > > Jessie > > ""Matthias Pigulla"" wrote in message > news:00A2E2156BEE8446A81C8881AE117F192C1D5D@companyweb... > > >>Von: Jessie Hernandez >>So, the question is, can we scrap both namespace constants >>and namespace functions and just stay with classes (as was >>agreed on several months ago, Andi himself agreeing to it)? > > ... > >>I think this is the best solution thus far. If any one of you >>still feels a need for constants/functions, PLEASE show me a >>_valid_ example that cannot be accomplished by just simply >>putting the constant/function inside a class in the namespace. > > > Bart de Boer came up with a good reason for them so I'd like to re-post > his statement. > > > Namespace constants can be handy if you'd want to include some library > that uses predefined constants and classes that might conflict with > other classes and constants in the script. > > namespace someLib { > > include('huge_conflicting_library_that_I_dont_want_to_reverse_engineer') > ; > > } > > > Of course, that would not only require to put defines [=constants?] and > functions in namespaces, but variables as well. > > namespace X { > var $foo = 1; > function bar($p) {} > } > > X::bar(X::$foo); > > which can, of course, not easily be distinguished from static class > members. > > So is the whole "include-legacy-stuff-into-namespace"-approach beyond > the scope of what you're trying to do? > > -mp.