Re: Re: Syntactic improvement to array
| From: | Richard Lynch | Date: | Mon, 05 Feb 2007 23:41:04 +0000 |
| Subject: | Re: Re: Syntactic improvement to array | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-27838@lists.php.net to get a copy of this message | ||
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?