Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19804 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34022 invoked by uid 1010); 29 Oct 2005 02:25:45 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 34007 invoked from network); 29 Oct 2005 02:25:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Oct 2005 02:25:44 -0000 X-Host-Fingerprint: 209.151.233.3 jekyll.safesearching.com Linux 2.4/2.6 Received: from ([209.151.233.3:40371] helo=jekyll.safesearching.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 57/B2-01249-8ADD2634 for ; Fri, 28 Oct 2005 22:25:44 -0400 Received: (qmail 5973 invoked from network); 28 Oct 2005 19:25:40 -0700 Received: from adsl-67-112-238-195.dsl.lsan03.pacbell.net (HELO ?192.168.1.135?) (67.112.238.195) by jekyll.safesearching.com with SMTP; 28 Oct 2005 19:25:40 -0700 Message-ID: <4362DFAB.1090701@safesearching.com> Date: Fri, 28 Oct 2005 19:34:19 -0700 User-Agent: Thunderbird 1.4.1 (Windows/20051006) MIME-Version: 1.0 To: Sebastian , internals@lists.php.net References: <4362C5F4.8090004@safesearching.com> <4e36d31d0510281847m3f54c70dy8b2a0679fa3c6cec@mail.gmail.com> In-Reply-To: <4e36d31d0510281847m3f54c70dy8b2a0679fa3c6cec@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] what happened to that new isset() like language From: james@safesearching.com (James Crumpton) Evaluating an idea based on it's syntactic similarities to other languages is complete and utter nonsense. It has nothing to with being like language Xyz. It has to do with familiarity to language constructs. One already understands the idea of 'this || that'. It's certainly doesn't take a stretch of the imagination to assume that at least a beginner programmer will believe that '$a = $this || $that;' would return one of the two values (as opposed to the boolean it now returns). The point is, I don't have to look up in the documentation what '||' means, or '? :' means... or (hypothetically) what '||=' means. They are concepts that are easy to understand and, more importantly, easy to remember. If this concept is turned into a function, it'll be another in a long list of functions for PHP that are difficult to remember for either their name (issetor? ifsetor? ifset?) or the order of arguments thereof (ie. array and string handling functions). Sebastian wrote: > Wow, it'll be just like perl! this is so great. > > On 10/28/05, James Crumpton wrote: >> Andi Gutmans wrote: >> > I don't think it's a matter of giving the engine a try. I think we first need >> > to make a decision what the best way to go is and then we can discuss >> > implementation if/what is possible. Once 5.0.0 is out I'm going to have more >> > time look into this. >> >> What's the word on this? >> >> Some of the names given were: >> issetor >> ifsetor >> ifset >> ifnull >> coalesce >> >> I'm actually kind of partial to: >> >> $a = $foo || $bar; >> $a = $foo || $bar || $xyz || $etc; >> >> Or better yet (or maybe in addition too): >> >> $a['foo'] ||= 'bar'; // if set do nothing, otherwise assign 'bar' >> >> >> -james >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > -- > > > > ------------- > buddhahead@gmail.com > >