Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:41535 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54014 invoked from network); 28 Oct 2008 19:27:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Oct 2008 19:27:28 -0000 Authentication-Results: pb1.pair.com header.from=josh.sickmate@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=josh.sickmate@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.78.26 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: josh.sickmate@gmail.com X-Host-Fingerprint: 74.125.78.26 ey-out-2122.google.com Received: from [74.125.78.26] ([74.125.78.26:31362] helo=ey-out-2122.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A6/D0-48169-F9767094 for ; Tue, 28 Oct 2008 14:27:28 -0500 Received: by ey-out-2122.google.com with SMTP id 5so988066eyj.59 for ; Tue, 28 Oct 2008 12:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=weJ+nYlfa48u9wFOU6CVOZvVyPUyySQtyH4xynx7nzY=; b=ZtB4TgLCNkxQ3SD5tQyegOIw16Jyw31BKuhpAXYFGncEvk5dBeQ5o/fY78DcQyzVjB ecL91jtf6608S9iXExY17vwbL1e2sxF+x7/fJdDn90J9+Sx0dfEee1qaDHX9Oy/+a3Mi MsDYjcm/SN/DU+Xito/UZI7D9ANzIFl1vrFt0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ToSkoCiYxUpzf3uaRdF9p5aFO7hHDZ6RD5jMUsGoPtI3unV04P9Akccx+OYK3xSAU9 1qk0s5wO5X5UeRIgxWJM7tUEzFP5FjuFx6j5iB61gs6bVIvUx+NQbiBP2cScgu0X3avi EiT6ct5rjIhlEbnvYvUwpFeEJMZISbEc7USVc= Received: by 10.210.141.4 with SMTP id o4mr5831632ebd.3.1225222044971; Tue, 28 Oct 2008 12:27:24 -0700 (PDT) Received: by 10.210.57.19 with HTTP; Tue, 28 Oct 2008 12:27:24 -0700 (PDT) Message-ID: <6fef9b880810281227p7291cbe0i6cf492347ba301b2@mail.gmail.com> Date: Wed, 29 Oct 2008 05:57:24 +1030 To: "Stan Vassilev | FM" Cc: internals@lists.php.net In-Reply-To: <1DF48FCDC8504BAC8131DD96191A7249@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <69907CB6763C4164A1AE82D659B80286@pc> <5A.30.00734.70AF6094@pb1.pair.com> <6fef9b880810280535j43bcbdbvef2531f471578697@mail.gmail.com> <1DF48FCDC8504BAC8131DD96191A7249@pc> Subject: Re: [PHP-DEV] Re: Clarifying the resolution rules From: josh.sickmate@gmail.com (Josh) Stan, You are so correct. I change my vote. Im assuming putting everything into the php namespace would allow 'use php', correct? In this case all that would be needed to get existing functionality would be to add 'use php' to the top of every file. Perhaps a small piece of logic could be added where if there is no namespace code in a file whatsoever (i.e. no 'namespace' or 'use'), then php could implicitly call 'use php', so that tons of non-namespace code would still work. Then when that code is converted to namespaces, the users have the option to add 'use php' to every file. Also, sorry about the bad comparisons. Regards, Josh On Tue, Oct 28, 2008 at 11:16 PM, Stan Vassilev | FM wrote: >> We are going to ignore the inherit problems that calling >> file_get_contents(__FILE__); would cause... >> >> Also, I disagree with a PHP namespace. the looseness of the language >> is one of its strong points. Some things should be made strict, I >> agree, bit it start with a php namespace and where does it end? If >> your not careful you end up with c# or java where doing anything >> requires going through hundreds of classes and packages. > > Please let's avoid bad comparisons :P > > We need to be very well aware that the concept of namespace in its simple, > clear, understandable form, represents: > > 1) no globals, everything in the namespace is in the namespace, including > vars, constants, functions, classes and nested namespaces. > > 2) to refer to a global namespace, there's no magical fallback to another > namespace (the global one), you need to "use" it specify it in your call > explicitly. The very idea of namespaces is, that other names don't leak into > your namespace. > > 3) we'll likely see in a future edition of PHP (5.4? 5.5? 6.0?) that many > currently global functions with "pseudo namespaces" like array_*(), > string_*() etc will gain concurrent aliases in a namespace: \array\*() > \string\*() since if we keep adding stuff in globals, then why introduce > namespaces at all? > > 4) any fallback, fudge, name leak, partial implementation represents > complication of the namespace concept, it's a compromise that makes > namespaces harder to implement, understand and use, but easier in the short > term for porting code and the "global functions all over the place" issue > PHP is so often criticised for. > > So, while I remain flexible on the scale of the options, I really wish > people don't just think in the short term, since short term solutions are > what caused the necessity to use "\" instead of "::" in the first place. > When you're cornered by your ill past decisions, you either break BC (which > we don't want to do), or add more WTF-s to the language as it evolves. > > Regards, Stan Vassilev > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >