Re: [PHP-DEV] Short syntax for array literals [...]
Andi Gutmans schrieb: Not sure we really reached a conclusion. I think it was inconclusive and people got tired. As I've stated in the past in general I don't like the ability to do things in more than one way but in this case I think the advantages of the cleaner syntax outweigh the fact that we'd have two ways. I'd prefer to support [] but I don't think it's a huge deal if we don't do it. It would make PHP a bit nicer :) Andi can I take this one as a +1? Sebastian -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
I'm not using this syntax. But I don't oppose it. On 5/22/08, Stan Vassilev | FM <[EMAIL PROTECTED]> wrote: > > Hi, > > I hear this often by other developers and I tend to agree with them, that > arrays are used often, and often nested, so that having a long syntax for > array literals tend to produce less legible code than in other scriping > languages. > > $a = array(array(1,2), array(3,4), 5, 6); > > $b = array('a' => 1, 'b' =>2); > > We use arrays in our configurations, in passing complex parameters to > functions, fetching information from databases, basically everything. So it > adds up. > > Some frameworks have somewhat funny attempts to remedy this by introducing > "shortcuts" like this: function a() { return func_get-args(); }. Of course > this doesn't work when you need to specify the key name, and the overhead > isn't worth it. > > It looks as there may not be a specific reason not to allow the JS syntax as > an alternative syntax (while keeping the current one in parallel): > > $a = [[1, 2], [3, 4], 5, 6]; > > $b = ['a' => 1, 'b' =>2]; > > There shouldn't be confusion to the parser as the brackets aren't preceded > by an identifier. > > Was this discussed before on the list? > > Regards, > > Stan Vassilev -- Regards, Wang Yi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
+1 On Fri, May 23, 2008 at 7:45 AM, Jani Taskinen <[EMAIL PROTECTED]> wrote: > Johannes Schlüter wrote: >> >> Hi, >> >> On Thu, 2008-05-22 at 12:33 +0200, "Pierre Joye" wrote: >>> >>> Agreed, we should simply go through a vote and be done with that. >> >> Vote until all are annoyed and don't vote against it anymore just to >> stop voting? ("it's less annoying to have it than vote about it every >> two months") There was some voting about this feature quite recently, >> don't have the archive link at hand. > > I vote for no votes. They're meaningless anyway. Whoever commits first, > wins. ;) > > Pierre: Care to reply to my email (sent to [EMAIL PROTECTED] several > times now..) > > --Jani > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP-DEV] Short syntax for array literals [...]
Johannes Schlüter wrote: Hi, On Thu, 2008-05-22 at 12:33 +0200, "Pierre Joye" wrote: Agreed, we should simply go through a vote and be done with that. Vote until all are annoyed and don't vote against it anymore just to stop voting? ("it's less annoying to have it than vote about it every two months") There was some voting about this feature quite recently, don't have the archive link at hand. I vote for no votes. They're meaningless anyway. Whoever commits first, wins. ;) Pierre: Care to reply to my email (sent to [EMAIL PROTECTED] several times now..) --Jani -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
On Fri, May 23, 2008 at 12:59 PM, Pierre Joye <[EMAIL PROTECTED]> wrote: > For the record here, +1. +1 (for informational purposes, do not have karma to actually vote) -- Alexey Zakhlestin http://blog.milkfarmsoft.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
On Fri, May 23, 2008 at 6:30 AM, Brian Moon <[EMAIL PROTECTED]> wrote: > Andi Gutmans wrote: >> >> It would make PHP a bit nicer :) >> >> Andi > > I almost typed it the other day not thinking. Been doing a lot of YUI and > {} and [] are growing on me. > > +1 For the record here, +1. -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
Hello, -100. This discussion is closed long ago.
Re: [PHP-DEV] Short syntax for array literals [...]
Andi Gutmans wrote: Not sure we really reached a conclusion. I think it was inconclusive and people got tired. As I've stated in the past in general I don't like the ability to do things in more than one way but in this case I think the advantages of the cleaner syntax outweigh the fact that we'd have two ways. I'd prefer to support [] but I don't think it's a huge deal if we don't do it. It would make PHP a bit nicer :) Andi I almost typed it the other day not thinking. Been doing a lot of YUI and {} and [] are growing on me. +1 -- Brian Moon Senior Developer/Engineer -- When you care enough to spend the very least. http://dealnews.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] Short syntax for array literals [...]
Not sure we really reached a conclusion. I think it was inconclusive and people got tired. As I've stated in the past in general I don't like the ability to do things in more than one way but in this case I think the advantages of the cleaner syntax outweigh the fact that we'd have two ways. I'd prefer to support [] but I don't think it's a huge deal if we don't do it. It would make PHP a bit nicer :) Andi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
Hi! Many of us like it. And the end users I know like it too. You don't need to convince me :) -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
On 22 May 2008, at 07:29, Pierre Joye wrote: On Thu, May 22, 2008 at 3:56 PM, Johannes Schlüter <[EMAIL PROTECTED]> wrote: Hi, On Thu, 2008-05-22 at 12:33 +0200, "Pierre Joye" wrote: Agreed, we should simply go through a vote and be done with that. Vote until all are annoyed and don't vote against it anymore just to stop voting? ("it's less annoying to have it than vote about it every two months") There was some voting about this feature quite recently, don't have the archive link at hand. Really? I missed the conclusion then. But if there was one, let begin to count. Whether something is concluded or not is in the eye of the beholder... but it appears the conclusion here is: This is too much [unnecessary] magic: - http://php.markmail.org/message/k2xoyx5ql65vj6r6 Regards, Philip -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
On Thu, May 22, 2008 at 3:56 PM, Johannes Schlüter <[EMAIL PROTECTED]> wrote: > Hi, > > On Thu, 2008-05-22 at 12:33 +0200, "Pierre Joye" wrote: >> Agreed, we should simply go through a vote and be done with that. > > Vote until all are annoyed and don't vote against it anymore just to > stop voting? ("it's less annoying to have it than vote about it every > two months") There was some voting about this feature quite recently, > don't have the archive link at hand. Really? I missed the conclusion then. But if there was one, let begin to count. -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
Hi, On Thu, 2008-05-22 at 12:33 +0200, "Pierre Joye" wrote: > Agreed, we should simply go through a vote and be done with that. Vote until all are annoyed and don't vote against it anymore just to stop voting? ("it's less annoying to have it than vote about it every two months") There was some voting about this feature quite recently, don't have the archive link at hand. johannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
On Thu, May 22, 2008 at 11:56 AM, Antony Dovgal <[EMAIL PROTECTED]> wrote: > On 22.05.2008 13:46, Pierre Joye wrote: >> >> On Thu, May 22, 2008 at 5:53 AM, Stanislav Malyshev <[EMAIL PROTECTED]> >> wrote: >>> >>> Hi! >>> $a = [[1, 2], [3, 4], 5, 6]; >>> >>> Proposed twice at least, but PHP developer community doesn't seem to like >>> it. >> >> Many of us like it. And the end users I know like it too. > > I see no advantages here, only another way to do already possible thing and > yet another way to confuse people. > But starting this discussion from the very beginning makes very little > sense. Agreed, we should simply go through a vote and be done with that. -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
On 22.05.2008 13:46, Pierre Joye wrote: On Thu, May 22, 2008 at 5:53 AM, Stanislav Malyshev <[EMAIL PROTECTED]> wrote: Hi! $a = [[1, 2], [3, 4], 5, 6]; Proposed twice at least, but PHP developer community doesn't seem to like it. Many of us like it. And the end users I know like it too. I see no advantages here, only another way to do already possible thing and yet another way to confuse people. But starting this discussion from the very beginning makes very little sense. -- Wbr, Antony Dovgal -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
On Thu, May 22, 2008 at 5:53 AM, Stanislav Malyshev <[EMAIL PROTECTED]> wrote: > Hi! > >> $a = [[1, 2], [3, 4], 5, 6]; > > Proposed twice at least, but PHP developer community doesn't seem to like > it. Many of us like it. And the end users I know like it too. Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
Hi! $a = [[1, 2], [3, 4], 5, 6]; Proposed twice at least, but PHP developer community doesn't seem to like it. -- Stanislav Malyshev, Zend Software Architect [EMAIL PROTECTED] http://www.zend.com/ (408)253-8829 MSN: [EMAIL PROTECTED] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Short syntax for array literals [...]
Hello Em Qui, 2008-05-22 às 05:12 +0300, Stan Vassilev | FM escreveu: > Was this discussed before on the list? Yes. http://marc.info/?l=php-internals&m=119995972028293&w=2 > > Regards, > Stan Vassilev -- Regards, Felipe Pena. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Short syntax for array literals [...]
Hi, I hear this often by other developers and I tend to agree with them, that arrays are used often, and often nested, so that having a long syntax for array literals tend to produce less legible code than in other scriping languages. $a = array(array(1,2), array(3,4), 5, 6); $b = array('a' => 1, 'b' =>2); We use arrays in our configurations, in passing complex parameters to functions, fetching information from databases, basically everything. So it adds up. Some frameworks have somewhat funny attempts to remedy this by introducing "shortcuts" like this: function a() { return func_get-args(); }. Of course this doesn't work when you need to specify the key name, and the overhead isn't worth it. It looks as there may not be a specific reason not to allow the JS syntax as an alternative syntax (while keeping the current one in parallel): $a = [[1, 2], [3, 4], 5, 6]; $b = ['a' => 1, 'b' =>2]; There shouldn't be confusion to the parser as the brackets aren't preceded by an identifier. Was this discussed before on the list? Regards, Stan Vassilev