Re: [PHP-DEV] annotations, vision, goals

2013-01-12 Thread Rasmus Schultz
I'm sorry, I guess I wasn't real clear on that - I've always known this feature as a source directive, guess I didn't know that's not really an established term. What I'm referring to is much simpler than what you suggested - it's just an equivalent to the "source" pre-processor directive in for e

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Galen Wright-Watson
On Sat, Jan 12, 2013 at 7:34 AM, Ben Ramsey wrote: > On 1/12/13 9:19 AM, Derick Rethans wrote: > >> I'm liking this, why start with an function alias already when >> introducing a new feature? >> > > I figured this would be a frequent question, and I was right. :-) > > In earlier discussions (Jun

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Stas Malyshev
Hi! > I can submit a new pull request against the master branch, if that's > acceptable. This is intended for 5.5. The patch should be against 5.5, I think. 5.5 is in alpha, so adding an isolated function to it is no problem (we're still considering adding a major language feature to it, so func

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Adam Jon Richardson
On Fri, Jan 11, 2013 at 7:17 PM, Ben Ramsey wrote: > I've opened voting for the array_column() function RFC. > > You can vote at https://wiki.php.net/rfc/array_column#voting No voting member, here, but I'd just like to say that I like the function, but I hope the actual implementation will only p

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Stas Malyshev
Hi! > Stas, I think you are misrepresenting this a bit. It's not about adding > something "cool looking", it's about adding a feature that solves *this > and many more* problems in a consistent way. A way that does *not* > require to add a new function for every single array manipulation. We alre

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Stas Malyshev
Hi! > 2) Developers coming from other languages (Ruby, JavaScript, etc.) will > instantly recognize array_pluck(). It's what they'll be looking for to > do the same thing, but they won't be looking for array_column(). I say nuke the alias :) I like array_column (maybe because English is not my

[PHP-DEV] VCS Account Request: cpriest

2013-01-12 Thread Clint Priest
Fix bugs, develop features and contribute to the core. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Thomas Hruska
On 1/12/2013 1:10 PM, Peter Cowburn wrote: On 12 January 2013 20:06, Galen Wright-Watson wrote: Just to be clear, do you mean the result would be: array($keys[0] => array($vals0[0], $vals1[0], ...), $keys[1] => array($vals0[1], $vals1[1], ...), ...) so the i-th item

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Peter Cowburn
On 12 January 2013 16:41, Ben Ramsey wrote: > > I must have misread the Git Workflow page of the wiki, which states: > > "A patch will be applied to the oldest possible branch. If the Release > Manager of 5.3 accepts the change, commit it to the 5.3 branch. We will use > regular merging between th

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Matt Pelmear
Hi, On 01/12/2013 07:34 AM, Ben Ramsey wrote: 2) Developers coming from other languages (Ruby, JavaScript, etc.) will instantly recognize array_pluck(). It's what they'll be looking for to do the same thing, but they won't be looking for array_column(). -Ben When I have to write JavaScri

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Pierre du Plessis
I'm not sure that adding this functionality in array_map would actually execute faster than doing array_combine($keys, array_map(null, $vals, $vals2, $vals3));. I will need to do some benchmarks to test, but I'm sure you will only see a performance improvement with extremely large arrays. Also why

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Peter Cowburn
On 12 January 2013 20:06, Galen Wright-Watson wrote: > > Just to be clear, do you mean the result would be: > array($keys[0] => array($vals0[0], $vals1[0], ...), > $keys[1] => array($vals0[1], $vals1[1], ...), > ...) > > so the i-th item in the result would be an array with

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Galen Wright-Watson
On Sat, Jan 12, 2013 at 11:41 AM, Thomas Hruska wrote: > [...] > > The array_map() changes would allow for multiple arrays of values: > > array_map($keys, $vals, $vals2, $vals3); > [...] > > But it would execute faster if it were supported in array_map(). If it is > supported in array_map(), then

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Lars Strojny
Hi Ben, Am 12.01.2013 um 01:17 schrieb Ben Ramsey : > I've opened voting for the array_column() function RFC. > > You can vote at https://wiki.php.net/rfc/array_column#voting I voted yes, but I prefer to call it just array_pluck (no aliases). It’s what underscore.js calls it and my own pet pro

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Thomas Hruska
On 1/12/2013 10:46 AM, Alexey Zakhlestin wrote: On 12.01.2013, at 21:34, Thomas Hruska wrote: This would allow developers to do things like: $keys = array('key1', 'key2', ..., 'keyn'); $vals = array('val1', 'val2', ..., 'valn'); $somemap = array_map($keys, $vals); Which would result in $so

Re: [PHP-DEV] annotations, vision, goals

2013-01-12 Thread Nikita Popov
On Sat, Jan 12, 2013 at 5:29 PM, Rasmus Schultz wrote: > I hear a lot of interesting arguments in this big annotation discussion, > and now there's the ongoing vision discussion, which got me thinking. > > It is true that there is broad community interest in annotations - part of > the problem he

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Clint Priest
On 1/12/2013 11:46 AM, Alexey Zakhlestin wrote: There is a function for this: http://docs.php.net/array_combine Nobody ever knows that one, I use it frequently, so useful. -- -Clint -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] array_map() function modification

2013-01-12 Thread Alexey Zakhlestin
On 12.01.2013, at 21:34, Thomas Hruska wrote: > This would allow developers to do things like: > > $keys = array('key1', 'key2', ..., 'keyn'); > $vals = array('val1', 'val2', ..., 'valn'); > > $somemap = array_map($keys, $vals); > > Which would result in $somemap containing: > > array('key1'

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Ben Ramsey
On 1/12/13 10:13 AM, Peter Cowburn wrote: 1. Why is this branch based on 5.3, rather than 5.4 or 5.5? Do you want this to be part of 5.3? The RFC (in particular the vote question) does not make it clear where/when you want this to be added. I mentioned this in another response on this thread. I

[PHP-DEV] array_map() function modification

2013-01-12 Thread Thomas Hruska
While we are on the general thought of arrays on this list, I was originally going to put in an idea for a new function and let it simmer for a while. Then I remembered that array_map() almost does what I want, but not quite. Someone can start a RFC if they like this idea. I thoroughly abuse

Re: [PHP-DEV] A remark about PHP's Vision and new things.

2013-01-12 Thread Yahav Gindi Bar
On Sat, Jan 12, 2013 at 7:35 AM, Levi Morrison wrote: > > Can we re-write PHP with PHP? ;) > > Anthony and Nikita are already on it: https://github.com/ircmaxell/PHPPHP > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > Just wish

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Ben Ramsey
On 1/12/13 10:17 AM, Levi Morrison wrote: 1. Why is this branch based on 5.3, rather than 5.4 or 5.5? Do you want this to be part of 5.3? The RFC (in particular the vote question) does not make it clear where/when you want this to be added. Please, this is not a bug or security fix. It does not

[PHP-DEV] annotations, vision, goals

2013-01-12 Thread Rasmus Schultz
I hear a lot of interesting arguments in this big annotation discussion, and now there's the ongoing vision discussion, which got me thinking. It is true that there is broad community interest in annotations - part of the problem here, is that different groups have differing opinions about precise

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Nikita Popov
On Sat, Jan 12, 2013 at 4:54 PM, Derick Rethans wrote: > > I know that not everyone agrees with that philosophy, but I personally > > don't like to add new features that can be easily covered by more > > general solutions, or features that just represent a hack because the > > more general soluti

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Levi Morrison
> 1. Why is this branch based on 5.3, rather than 5.4 or 5.5? Do you > want this to be part of 5.3? The RFC (in particular the vote question) > does not make it clear where/when you want this to be added. Please, this is not a bug or security fix. It does not belong in 5.3. -- PHP Internals - PH

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Peter Cowburn
On 12 January 2013 00:17, Ben Ramsey wrote: > I've opened voting for the array_column() function RFC. > > You can vote at https://wiki.php.net/rfc/array_column#voting > I like the idea of this function, but have a few minor questions re. the current implementation. 1. Why is this branch based on

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Thomas Hruska
On 1/11/2013 11:53 PM, Anthony Ferrara wrote: From what I can see this new function doesn't fit any of those three to a significant enough extent. All three are definitely subjective, but I'm leaning towards a no vote because I just don't feel there's enough justification for the new function wh

Re: [PHP-DEV] A remark about PHP's Vision and new things.

2013-01-12 Thread Anthony Ferrara
In a semi-joke but oddly real concept. I get that the language proposals (c++) are half jokes. But if we're going down that road, why don't we consider rpython and building on top of HippyVM that's already partially built... It would have a number of advantages over C: 1. It compiles to C, so shou

Re: [PHP-DEV] A remark about PHP's Vision and new things.

2013-01-12 Thread guilhermebla...@gmail.com
Not really insane. PHPPHP is very powerful. Imagine someone that have no idea about C but would love to propose something. Just fork the project, add the desired support in PHP and propose here. I guarantee it'll be easier to understand the caveats and the final patch easily. Cheers, On Sat, Ja

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Clint Priest
My .02 cents here... I'm used to array_pluck(), even when I first saw it I was like WTH is that? When you read the description though, 'plucking' is a verb which describes the action the function is taking, while column is a noun and does not describe the action the function is taking. In f

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Derick Rethans
On Sat, 12 Jan 2013, Nikita Popov wrote: > On Sat, Jan 12, 2013 at 6:57 AM, Stas Malyshev wrote: > > > This is a great illustration of different visions we have here. On > > one hand, we have practical, immediate feature that covers a clear > > use case and does not add any constructs or comple

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Ben Ramsey
On 1/12/13 9:19 AM, Derick Rethans wrote: I'm liking this, why start with an function alias already when introducing a new feature? I figured this would be a frequent question, and I was right. :-) In earlier discussions (June 2012), when I first introduced array_column(), much of the discuss

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Ben Ramsey
On 1/12/13 9:14 AM, Peter Cowburn wrote: The "Status" for this RFC is still "Under discussion" and on the RFC listing page it is the same. Is not changing those two things simply an oversight? It was an oversight. I have corrected it in both places. -- PHP Internals - PHP Runtime Development

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Derick Rethans
On Fri, 11 Jan 2013, Stas Malyshev wrote: > > Voting no, because - even though I like this feature in principle - I think > > it's much better solved by introducing list comprehensions (which cover > > this and many more cases in a consistent and elegant syntax), which is > > something I have plan

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Derick Rethans
On Fri, 11 Jan 2013, Ben Ramsey wrote: > I've opened voting for the array_column() function RFC. > > You can vote at https://wiki.php.net/rfc/array_column#voting I'm liking this, why start with an function alias already when introducing a new feature? cheers, Derick -- PHP Internals - PHP Ru

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Peter Cowburn
On 12 January 2013 00:17, Ben Ramsey wrote: > I've opened voting for the array_column() function RFC. > > You can vote at https://wiki.php.net/rfc/array_column#voting > > Regards, > Ben > The "Status" for this RFC is still "Under discussion" and on the RFC listing page it is the same. Is not chan

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Nikita Popov
On Sat, Jan 12, 2013 at 6:57 AM, Stas Malyshev wrote: > Hi! > > > Voting no, because - even though I like this feature in principle - I > think > > it's much better solved by introducing list comprehensions (which cover > > this and many more cases in a consistent and elegant syntax), which is > >

Re: [PHP-DEV] [VOTE] array_column() function

2013-01-12 Thread Levi Morrison
The real problem here (in my opinion) is that `array_filter` does not pass the key information to the callback. If you could do that, you could select columns that way. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php