Re: New package: Functional PHP
| From: | Richard Quadling | Date: | Fri, 10 Jun 2011 09:19:04 +0000 |
| Subject: | Re: New package: Functional PHP | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-8338@lists.php.net to get a copy of this message | ||
On 9 June 2011 19:06, Lars Strojny <lars@strojny.net> wrote:
> Good evening everybody,
>
> I would like to propose a new package for PECL, Functional PHP. It
> provides a number of functions for functional’ish programming like map(),
> invoke(), reduce_left(), reduce_right() and so on. License is BSD, code is
> available at https://github.com/lstrojny/functional-php/.
> Proposed name
> would be „functional“.
So now I can almost write Javascript code in PHP. Add the JSONy logic
and soon I won't know where I'm working, what I'm writing or anything.
Sounds great! Bring it on.
One word. Can all the iterators please supply both key/index and value.
One thing I fall foul of with PHP's built-in array functions is that
some of those that use callbacks will supply the value and key and
other only the value to the callback.
Should always be both in my mind. Even if that arrays as an array
rather than 2 parameters.
I use PrototypeJS and their each() passes the value as the first
parameter and the key/index as the second parameter to the callback.
That's fine by me.
--
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea