Re: [PHP-DEV] Expose compare_function() to userspace

2010-10-03 Thread Richard Lynch
On Thu, September 30, 2010 9:44 am, Adam Harvey wrote: > Unrelated to the Comparable RFC, are there any objections to adding a > function that simply wraps compare_function()? It's depressingly > common to end up writing a construct like the following in comparison > callbacks, so I think we might

Re: [PHP-DEV] Expose compare_function() to userspace

2010-10-01 Thread Hannes Magnusson
On Thu, Sep 30, 2010 at 16:44, Adam Harvey wrote: > Well, while I'm sending e-mails... > > Unrelated to the Comparable RFC, are there any objections to adding a > function that simply wraps compare_function()? It's depressingly > common to end up writing a construct like the following in compariso

Re: [PHP-DEV] Expose compare_function() to userspace

2010-10-01 Thread Michael Wallner
On 10/01/2010 12:26 AM, Stas Malyshev wrote: Hi! Can we make it an operator-like (is_a for example) instead? It could be more efficient. Operator has a downside that you can't pass it as a parameter. We could have something like <=> (spaceship operator!) or even cmp though :) OT: Stas, coul

Re: [PHP-DEV] Expose compare_function() to userspace

2010-09-30 Thread Adam Harvey
On 1 October 2010 06:26, Stas Malyshev wrote: >> Can we make it an operator-like (is_a for example) instead? It could >> be more efficient. > > Operator has a downside that you can't pass it as a parameter. We could have > something like <=> (spaceship operator!) or even cmp though :) Yeah, I thi

Re: [PHP-DEV] Expose compare_function() to userspace

2010-09-30 Thread Stas Malyshev
Hi! Can we make it an operator-like (is_a for example) instead? It could be more efficient. Operator has a downside that you can't pass it as a parameter. We could have something like <=> (spaceship operator!) or even cmp though :) -- Stanislav Malyshev, Software Architect SugarCRM: http://w

Re: [PHP-DEV] Expose compare_function() to userspace

2010-09-30 Thread Pierre Joye
hi, On Thu, Sep 30, 2010 at 10:13 PM, Stas Malyshev wrote: > I'd like var_compare(). > Quick search in google reveals cmp() being used in actual code, and > compare() to some extent too, though mostly as method, so not really > clashing. Sounds good. Can we make it an operator-like (is_a for e

Re: [PHP-DEV] Expose compare_function() to userspace

2010-09-30 Thread Stas Malyshev
Hi! If I don't hear kicking and screaming in the next few days, I'll slip this into trunk. I can provide a patch/RFC in advance if there's demand, but it'll be about as simple as you imagine. :) Sounds good. The one thing that I would like bikeshedding^Wfeedback on is the name: cmp() makes t

Re: [PHP-DEV] Expose compare_function() to userspace

2010-09-30 Thread Richard Quadling
On 30 September 2010 15:44, Adam Harvey wrote: > Well, while I'm sending e-mails... > > Unrelated to the Comparable RFC, are there any objections to adding a > function that simply wraps compare_function()? It's depressingly > common to end up writing a construct like the following in comparison >

[PHP-DEV] Expose compare_function() to userspace

2010-09-30 Thread Adam Harvey
Well, while I'm sending e-mails... Unrelated to the Comparable RFC, are there any objections to adding a function that simply wraps compare_function()? It's depressingly common to end up writing a construct like the following in comparison callbacks, so I think we might as well encapsulate the pat