On Sat, Jan 12, 2013 at 6:57 AM, Stas Malyshev <smalys...@sugarcrm.com>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
> > something I have planned for 5.6.
>
> 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 complexity to the core language and
> services immediate need, covering several lines of frequently
> encountered boilerplate code with one function.
>
> On the other hand, we have a possibility to have in the future a
> fashionable syntax, which is a bit better, more concise and "cool
> looking" expression for what foreach already can do.
>

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.

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
solution isn't implemented yet. This is also the reason why I don't
particularly like your argument skipping proposal, because it's just a hack
around the lack of named arguments. The thing with the argument skipping
proposal is though that the alternative (named args) is pretty hard to
implement and we might not actually get them any time soon. Here it is
different as list comprehensions are more or less a triviality.

That's why I think that this is not necessary. It will be hopefully
properly handled in the future and until then this function is trivial
enough to just write it yourself. I don't see how we need yet another
array_ function for it.

But hey, just my opinion, not everyone has to agree with this :)

Thanks,
Nikita

Reply via email to