Re: Syntactic improvement to array

From: Date: Tue, 06 Feb 2007 15:29:38 +0000
Subject: Re: Syntactic improvement to array
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-27858@lists.php.net to get a copy of this message
how it is different? How explaining array written as [] so much harder that explaining array written as ()? What exactly constitutes the problem?
Here's the difference: You can Google for 'array' and learn a lot. If you try to Google for [] you don't learn squat. Try it and see. So our 'newbie' at least has a good chance of figuring out array(1, 2, 3) on their own. They've got must worse odds of figuring out [1,2,3]
Ok. So I propose more "searcheable" operators:
let($i, 1)                 ===     $i = 1
let($d, add($a, $b, $c))   ===     $d = $a + $b + $c
call(foo, $arg1, $arg2)    ===     foo($arg1, $arg2)
:-) Our 'newbie' at least has a good chance of figuring out
   $a = [1,2,3]          vs.        $a = array(1,2,3)
is different than $a = foobar(1,2,3) -- Tullio Andreatta Disclaimer: "Please treat this email message in a reasonable way, or we might get angry" ( http://www.goldmark.org/jeff/stupid-disclaimers )

« previous php.internals (#27858) next »