<div dir="auto"><div><div dir="auto">Hi Michael,</div><div dir="auto"><br></div>Anonymous functions would've been quite nice, but could your example only be used for a single argument?<br><div class="gmail_extra"><br><div class="gmail_quote">Op 2 aug. 2017 17:44 schreef "Michael Kay" <<a href="mailto:mike@saxonica.com">mike@saxonica.com</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">><br>
> To put things in perspective, => was introduced in version 3.1, together with map and array support. As far as I understand it and looking again at the specs, one of the use cases is for => to be used with maps and arrays, in an object-oriented style.<br>
<br>
<br>
</div>In particular, arrays don't have a filter operator in the way that sequences do, neither do they have a mapping operator, so to select into an array of maps you need to do things like<br>
<br>
$A => a:filter( function($m) {$m?name='Mike'}) => a:for-each( function($m) { $m?age })<br>
<br>
which gets terribly unwieldy if you try to write it with conventional nested function calls.<br>
<br>
I wish we had done a concise anonymous function declaration as well:<br>
<br>
$A => a:filter( {?name='Mike'} ) => a:for-each( {?age} )<br>
<br>
Here {EXPR} is shorthand for "function($x){ $x ! EXPR }"<br>
<br>
but that would have been a bridge too far for some people.<br>
<font color="#888888"><br>
Michael Kay<br>
Saxonica<br>
<br>
<br>
<br>
 </font></blockquote></div><br></div></div></div>