On 10 July 2011 22:23, David Herman <dher...@mozilla.com> wrote:
> Another common and useful fusion of two traversals that's in many Schemes is 
> map-filter or filter-map:
>
>    a.filterMap(f) ~~~ [res for [i,x] of items(a) let (res = f(x, i)) if (res 
> !== void 0)]
>
> I rather arbitrarily chose to accept both null and undefined here as way to 
> say "no element" -- a reasonable alternative would be to accept *only* 
> undefined as "no element".

\bikeshed{ The SML lib calls this one mapPartial, which I think is a
much better name. }

/Andreas
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to