Re: Re: Syntactic improvement to array

From: Date: Tue, 06 Feb 2007 17:27:45 +0000
Subject: Re: Re: Syntactic improvement to array
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-27863@lists.php.net to get a copy of this message
That's because you wouldn't be using those words with a newbie, if you are smart. You'd simply say "it works like list() here" and "it works like array()" here. -Andrei On Feb 5, 2007, at 3:41 PM, Richard Lynch wrote:
On Mon, February 5, 2007 12:06 pm, Andrei Zmievski wrote:
On Feb 4, 2007, at 8:52 PM, Richard Lynch wrote:
Ewwwwwwww! So now we have an invisible operator with a magical symbol '[' which *sometimes* means create an array, but *sometimes* means to de-construct an array into individual variables? That's just disgusting, imho. -1 !!!
The way I view [] is that it creates an array "context". When the context is an RHS, it instantiates an array. When it's an LHS, the context deconstructs the array.
I can 'splain list() to a newbie and get them to understand it as an array deconstructor function thingie, and usually succeed in one or two tries to get it into their heads. I don't think I can do that with [] and LHS and RHS in anything like 2 tries... More like 10 times, probably. --Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?


« previous php.internals (#27863) next »