Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-02-17 Thread Eric Coleman
+1 I hope this didn't die; As a developer, I really like to use this syntax, and find it preferably from working with javascript, ruby, python, etc. Regards, Eric On Jan 21, 2008, at 12:36 AM, taylor luk wrote: +1 firstly, square brackets are natural short cut to array(...) that you c

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-20 Thread taylor luk
+1 firstly, square brackets are natural short cut to array(...) that you can find in many many language, one may argue this is merely a minor addition. however, PHP is already a very verbose compare to other language, syntactic improvements adds up it allows us to create much more readable code.

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-19 Thread Darius Jahandarie
Antony Dovgal wrote: > On 10.01.2008 13:07, Ryusuke SEKIYAMA wrote: >> Hello, lists, >> >> I'm tired to type "array()" many times. > > -1 > > The parser in my head is unable to parse this: > $var=["str"]; > $var["str"]=1; > ?> > Eh, that would just come out as [ 0 => "str", "str" => 1 ] No

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-11 Thread Max Antonov
a) Commit square bracket array shortcut patch keys and values are separated by colons. ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch ) e.g. $a = [1, 2, 3]; $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon']; Breaks from PHP's => for no apparent reason (one charact

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-11 Thread Geoffrey Sneddon
On 11 Jan 2008, at 14:28, Mark Dennehy wrote: b) Commit square bracket array shortcut patch keys and values are separated by double arrows. Breaks backwards compatibility to save typing five characters. See above. -1. It doesn't break backwards compatibility; the new syntax is an alias,

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-11 Thread Mark Dennehy
On Jan 11, 2008 2:17 PM, Geoffrey Sneddon <[EMAIL PROTECTED]> wrote: > I don't think tiredness to type an extra five characters should be an > excuse to change the syntax. No, but clarity of expression is a valid reason to do so. > > a) Commit square bracket array shortcut patch > >keys an

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-11 Thread Geoffrey Sneddon
On 10 Jan 2008, at 10:07, Ryusuke SEKIYAMA wrote: I'm tired to type "array()" many times. And I want to declare arrays more easily. So I wrote the patch for zend_language_parser.y which enables to declare arrays with square brackets like some other languages. I don't think tiredness to type a

RE: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-11 Thread Jani Taskinen
> > -Original Message- > > From: Ryusuke SEKIYAMA [mailto:[EMAIL PROTECTED] > > Sent: Thursday, January 10, 2008 2:08 AM > > To: internals@lists.php.net > > Cc: Marcus Boerger; Stas Malyshev > > Subject: [PHP-DEV] [RFC] Square brackets shortcut > >

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-11 Thread Antony Dovgal
On 10.01.2008 13:07, Ryusuke SEKIYAMA wrote: > Hello, lists, > > I'm tired to type "array()" many times. -1 The parser in my head is unable to parse this: -- Wbr, Antony Dovgal -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Ron Radko
Hi, I hope this is the appropriate list. I have been banging on this issue for quite some time. Basically, I have an intermittent problem with various stream calls. Essentially, I see massive CPU utilization while waiting to get data from some http locations, under some circumstances. This is

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Tomi Kaistila
> The [] array literal syntax is also used by Javascript, and there's even an > object literal syntax, {}, which is quite nice. Does that mean "Javascript > is classic Perl"? Yes, the first thing that comes to mind from this syntax is Perl. (1, 2, 3, 4, 5) ("dharma", "wilma", "greg", "mina") qw{

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Larry Garfield
On Thursday 10 January 2008, Tomi Kaistila wrote: > Well if confusing is the goal, then yes, since this is classic Perl. > > I started using PHP, instead of Perl, just so that I would not need play > around with confusing syntax. > > Tomi Kaistila > PHP Developer The [] array literal syntax is als

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread David Coallier
a different thread :) > > Andi > > > > -Original Message- > > From: Hannes Magnusson [mailto:[EMAIL PROTECTED] > > Sent: Thursday, January 10, 2008 6:49 AM > > To: Sam Barrow > > Cc: PHP Development > > Subject: Re: [PHP-DEV] [RFC] Square brackets sh

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Derick Rethans
On Thu, 10 Jan 2008, Hannes Magnusson wrote: > So you reject scalar type hinting because it isn't type casting and > can therefor confuses newbies - but scattering seemingly random > brackets around your code (to safe 5 key strokes) is obvious to users? > > Noone would confuse this with named arg

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Pierre
Hi, On Jan 10, 2008 11:07 AM, Ryusuke SEKIYAMA <[EMAIL PROTECTED]> wrote: > b) Commit square bracket array shortcut patch > keys and values are separated by double arrows. > ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch ) > e.g. > $a = [1, 2, 3]; > $b = ['foo' =

RE: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Andi Gutmans
ilto:[EMAIL PROTECTED] > Sent: Thursday, January 10, 2008 6:49 AM > To: Sam Barrow > Cc: PHP Development > Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut > > Did you know that you don't have to reply multiple times to the same > post? > And even though Stas replies t

RE: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Andi Gutmans
I recommended (b) a few months back and got shot down :) I still like it :) Andi > -Original Message- > From: Ryusuke SEKIYAMA [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 10, 2008 2:08 AM > To: internals@lists.php.net > Cc: Marcus Boerger; Stas Malyshev > Subje

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Daniel Brown
On Jan 10, 2008 9:39 AM, Sam Barrow <[EMAIL PROTECTED]> wrote: > On Thu, 2008-01-10 at 14:56 +0100, Hannes Magnusson wrote: > > So you reject scalar type hinting because it isn't type casting and > > can therefor confuses newbies - but scattering seemingly random > > brackets around your code (to s

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Hannes Magnusson
Did you know that you don't have to reply multiple times to the same post? And even though Stas replies to every single post, you don't have to do it too. Please read Andis "checklist" again; http://news.php.net/php.internals/34494 - same "rules" apply to all threads. -Hannes On Jan 10, 2008 3:

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Sam Barrow
On Thu, 2008-01-10 at 14:56 +0100, Hannes Magnusson wrote: > So you reject scalar type hinting because it isn't type casting and > can therefor confuses newbies - but scattering seemingly random > brackets around your code (to safe 5 key strokes) is obvious to users? > > Noone would confuse this w

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Sam Barrow
I just tried this out using option b, and I really like it. $var = [1, 6, 434] ; I think it looks good and helps code readability alot. On Thu, 2008-01-10 at 19:07 +0900, Ryusuke SEKIYAMA wrote: > Hello, lists, > > I'm tired to type "array()" many times. And I want to > declare arrays more easi

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Sam Barrow
On Thu, 2008-01-10 at 16:18 +0200, Giedrius D wrote: > Hi, > > On Jan 10, 2008 3:56 PM, Hannes Magnusson <[EMAIL PROTECTED]> wrote: > > So you reject scalar type hinting because it isn't type casting and > > can therefor confuses newbies - but scattering seemingly random > > brackets around your c

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Lukas Kahwe Smith
On Jan 10, 2008, at 3:12 PM, Tomi Kaistila wrote: Well if confusing is the goal, then yes, since this is classic Perl. I started using PHP, instead of Perl, just so that I would not need play around with confusing syntax. Right, PHP was always about making it easy to see whats going on an

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Sam Barrow
I like b. On Thu, 2008-01-10 at 19:07 +0900, Ryusuke SEKIYAMA wrote: > Hello, lists, > > I'm tired to type "array()" many times. And I want to > declare arrays more easily. So I wrote the patch for > zend_language_parser.y which enables to declare arrays > with square brackets like some other lan

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Giedrius D
Hi, On Jan 10, 2008 3:56 PM, Hannes Magnusson <[EMAIL PROTECTED]> wrote: > So you reject scalar type hinting because it isn't type casting and > can therefor confuses newbies - but scattering seemingly random > brackets around your code (to safe 5 key strokes) is obvious to users? > > Noone would

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Tomi Kaistila
Well if confusing is the goal, then yes, since this is classic Perl. I started using PHP, instead of Perl, just so that I would not need play around with confusing syntax. Tomi Kaistila PHP Developer On Thursday 10 January 2008 15:56:54 Hannes Magnusson wrote: > So you reject scalar type hintin

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Hannes Magnusson
So you reject scalar type hinting because it isn't type casting and can therefor confuses newbies - but scattering seemingly random brackets around your code (to safe 5 key strokes) is obvious to users? Noone would confuse this with named arguments? Why can't I do function foo([] $array) {} ? foo

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Saulo Vallory
If we are going to implement this, I think we should use the (b) syntax since its how you define array elements today On Jan 10, 2008 8:19 AM, Marcus Boerger <[EMAIL PROTECTED]> wrote: > Hello Ryusuke, > > I like b) ! > > marcus > > Thursday, January 10, 2008, 11:07:36 AM, you wrote: > > > Hello

Re: [PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Marcus Boerger
Hello Ryusuke, I like b) ! marcus Thursday, January 10, 2008, 11:07:36 AM, you wrote: > Hello, lists, > I'm tired to type "array()" many times. And I want to > declare arrays more easily. So I wrote the patch for > zend_language_parser.y which enables to declare arrays > with square brackets

[PHP-DEV] [RFC] Square brackets shortcut

2008-01-10 Thread Ryusuke SEKIYAMA
Hello, lists, I'm tired to type "array()" many times. And I want to declare arrays more easily. So I wrote the patch for zend_language_parser.y which enables to declare arrays with square brackets like some other languages. Stanislav, Sorry, I'm new in this list and I didn't know about past discu