On 10 July 2011 22:23, David Herman <[email protected]> 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".
The way I think of it is that in analogy to NaN being the Numbers that represent no number, null is the Object that represents no object, in other words a reasonable value to store to tell just that. The undefined value is by analogy the value that represents no value, so is the only value that should be a "no element". But that might be just my way of thinking about and distinguishing the not-a-something special cases. -- David "liorean" Andersson _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

