rfc:operator_functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:operator_functions [2017/09/09 00:17] – clarify ajf | rfc:operator_functions [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 62: | Line 62: | ||
<code php> | <code php> | ||
// Select only the positive numbers | // Select only the positive numbers | ||
- | $positiveSubset = array_filters($numbers, partialApply(' | + | $positiveSubset = array_filter($numbers, partialApply(' |
</ | </ | ||
+ | |||
+ | An example working partial application implementation would be: | ||
+ | |||
+ | <file php partialApply.php> | ||
+ | function partialApply(callable $c, ...$args) { | ||
+ | return function (...$args2) use ($c, $args) { | ||
+ | return $c(...$args, | ||
+ | }; | ||
+ | } | ||
+ | </ | ||
==== Detail ==== | ==== Detail ==== | ||
Line 153: | Line 163: | ||
The existing operators themselves behave the same as ever. | The existing operators themselves behave the same as ever. | ||
- | Quoting | + | Being able to quote function names in function calls (e.g. < |
===== Future Scope ===== | ===== Future Scope ===== |
rfc/operator_functions.1504916227.txt.gz · Last modified: 2017/09/22 13:28 (external edit)