| From | Sent On | Attachments |
|---|---|---|
| Christian Schneider | Nov 4, 2003 3:32 pm | .patch |
| Rasmus Lerdorf | Nov 4, 2003 5:06 pm | |
| Ken Tossell | Nov 4, 2003 5:09 pm | |
| Andi Gutmans | Nov 5, 2003 12:49 am | |
| Michael Walter | Nov 5, 2003 12:59 am | |
| Michael Walter | Nov 5, 2003 1:03 am | |
| Kouber Saparev | Nov 5, 2003 1:47 am | |
| Christian Schneider | Nov 5, 2003 2:06 am | |
| s0niX | Nov 5, 2003 2:43 am | |
| Ford, Mike [LSS] | Nov 5, 2003 3:20 am | |
| Mike Robinson | Nov 5, 2003 3:26 am | |
| Dirkjan Ochtman | Nov 5, 2003 3:45 am | |
| Cesare D'Amico | Nov 5, 2003 4:02 am | |
| Alexey Trunyov | Nov 5, 2003 4:34 am | |
| Antony Dovgal | Nov 5, 2003 4:59 am | |
| Marco Tabini | Nov 5, 2003 5:04 am | |
| Ilia Alshanetsky | Nov 5, 2003 5:06 am | |
| Magnus Määttä | Nov 5, 2003 5:07 am | |
| Derick Rethans | Nov 5, 2003 5:18 am | |
| Christian Schneider | Nov 5, 2003 7:34 am | |
| Nicolas Toper | Nov 5, 2003 7:47 am | |
| Ilia Alshanetsky | Nov 5, 2003 7:56 am | |
| Antony Dovgal | Nov 5, 2003 8:03 am | |
| Rasmus Lerdorf | Nov 5, 2003 8:21 am | |
| Christian Schneider | Nov 5, 2003 8:30 am | |
| Andrey Hristov | Nov 5, 2003 8:40 am | |
| Ilia Alshanetsky | Nov 5, 2003 8:47 am | |
| Andi Gutmans | Nov 5, 2003 8:47 am | |
| Jani Taskinen | Nov 5, 2003 8:49 am | |
| Ford, Mike [LSS] | Nov 5, 2003 8:50 am | |
| Marco Tabini | Nov 5, 2003 8:52 am | |
| Christian Schneider | Nov 5, 2003 8:54 am | |
| George Schlossnagle | Nov 5, 2003 8:58 am | |
| Jani Taskinen | Nov 5, 2003 8:59 am | |
| Christian Schneider | Nov 5, 2003 9:00 am | |
| Ford, Mike [LSS] | Nov 5, 2003 9:00 am | |
| Marco Tabini | Nov 5, 2003 9:01 am | |
| Marco Tabini | Nov 5, 2003 9:05 am | |
| Ford, Mike [LSS] | Nov 5, 2003 9:07 am | |
| Ford, Mike [LSS] | Nov 5, 2003 9:09 am | |
| Marco Tabini | Nov 5, 2003 9:18 am | |
| Romans Malinovskis | Nov 5, 2003 9:19 am | |
| Andi Gutmans | Nov 5, 2003 9:20 am | |
| Steph | Nov 5, 2003 9:25 am | |
| Andrey Hristov | Nov 5, 2003 9:25 am | |
| Ilia Alshanetsky | Nov 5, 2003 9:25 am | |
| Marco Tabini | Nov 5, 2003 9:30 am | |
| Derick Rethans | Nov 5, 2003 9:33 am | |
| George Schlossnagle | Nov 5, 2003 9:36 am | |
| Rasmus Lerdorf | Nov 5, 2003 9:45 am | |
| Edin Kadribasic | Nov 5, 2003 9:45 am | |
| Romans Malinovskis | Nov 5, 2003 9:48 am | |
| Moriyoshi Koizumi | Nov 5, 2003 9:50 am | |
| Jani Taskinen | Nov 5, 2003 9:54 am | |
| Jaap van Ganswijk | Nov 5, 2003 10:06 am | |
| Michael Walter | Nov 5, 2003 10:12 am | |
| Cesare D'Amico | Nov 5, 2003 10:22 am | |
| Marco Tabini | Nov 5, 2003 10:28 am | |
| Michael Walter | Nov 5, 2003 10:30 am | |
| Michael Walter | Nov 5, 2003 10:35 am | |
| George Schlossnagle | Nov 5, 2003 10:36 am | |
| Andrei Zmievski | Nov 5, 2003 10:39 am | |
| George Schlossnagle | Nov 5, 2003 10:56 am | |
| David Enderson | Nov 5, 2003 11:02 am | |
| Marco Tabini | Nov 5, 2003 11:10 am | |
| Shane Caraveo | Nov 5, 2003 11:12 am | |
| Michael Walter | Nov 5, 2003 12:26 pm | |
| Greg MacLellan | Nov 5, 2003 12:40 pm | |
| Robert Cummings | Nov 5, 2003 1:08 pm | |
| David Enderson | Nov 5, 2003 1:19 pm | |
| Sara Golemon | Nov 5, 2003 2:40 pm | |
| George Schlossnagle | Nov 5, 2003 3:00 pm | |
| Wez Furlong | Nov 5, 2003 4:06 pm | |
| Christian Schneider | Nov 5, 2003 5:07 pm | |
| Ard Biesheuvel | Nov 5, 2003 5:27 pm | |
| Christian Schneider | Nov 5, 2003 5:50 pm | |
| Andi Gutmans | Nov 6, 2003 12:03 am | |
| Stig S. Bakken | Nov 6, 2003 12:58 am | |
| Kouber Saparev | Nov 6, 2003 1:24 am | |
| Mike Robinson | Nov 6, 2003 3:31 am | |
| Andi Gutmans | Nov 6, 2003 4:04 am | |
| Ford, Mike [LSS] | Nov 6, 2003 4:09 am | |
| Alexey Trunyov | Nov 6, 2003 4:15 am | |
| Ford, Mike [LSS] | Nov 6, 2003 4:27 am | |
| Sascha Schumann | Nov 6, 2003 4:30 am | |
| Andi Gutmans | Nov 6, 2003 5:28 am | |
| Sascha Schumann | Nov 6, 2003 5:46 am | |
| Stig S. Bakken | Nov 6, 2003 6:32 am |
| Subject: | RE: [PHP-DEV] Proposal: Array syntax | |
|---|---|---|
| From: | Ford, Mike [LSS] (M.F...@lmu.ac.uk) | |
| Date: | Nov 6, 2003 4:09:32 am | |
| List: | net.php.lists.internals | |
On 05 November 2003 17:19, Marco Tabini wrote:
Ford, Mike [LSS] wrote:
On 05 November 2003 17:06, Marco Tabini contributed these pearls of wisdom:
Christian Schneider wrote:
Marco Tabini wrote:
$a = [[1,2,3],[1=>[1,3,2,2], "a"=>[[1,2,3,4],4,[1,2]]];
$a = array(array(1,2,3),array(1=>array(1,3,2,2), "a"=>array(array(1,2,3,4),4,array(1,2)));
Besides my previous points, something even more abominable:
$a = [1,2,$b[11]];
Is that confusing enough for you? ;-)
What's confusing about it?
The fact that $b[11] references an item of an array, while [1,2,$b[11]] assigns values to the array $a.
That's not confusing -- at least no more so than the different meanings of - in $b = -$a and $b = $c - $a.
The fact that you (and, probably, most of us) can't tell right off the bat
Bzzt! Wrong! It was because I *could* tell right off the bat exactly what it meant that I asked why it was confusing.
is a clear sign that this is a bad idea, because it's ambiguous and confusing.
And again, wrong assumption -- I asked what's confusing because to me it looks completely unambiguous and totally clear.
The same line using the current syntax, btw, would have looked like this:
$a = array (1,3,$b[11]);
Well, I can see true enough that that has the same meaning, but for me it's harder to read and interpret. I see the () first and start assuming it's a function, before my eyes and brain have time to digest that the name of the "function" is array -- result: a moment's confusion whilst I deal with the ambiguity of using function syntax for a language construct. With the [] syntax, I see the square brackets and they immediately shout ARRAY CONSTRUCTOR at me -- result: instant understanding and I'm on to the next line of code in a flash.
Cheers!
Mike
--------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.f...@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211






.patch