On Tue Feb 24 2015 at 12:22:25 PM Mark S. Miller <[email protected]> wrote:
> As always with proposals to extend arity -- even if reserved by a thrown
> error in a previous release -- how would you feature test for the extended
> functionality?
>
> I suspect the awkwardness of feature testing is one of the reasons why we
> have not previously added new functionality by extending arity of existing
> std functions. Though reserving by throwing does change the game somewhat.
> Does it change the game enough?
>
TBH, I've never encountered the issue that Dr. Rauschmayer reported—so I'm
not convinced that it's necessary to do anything about it at all. I only
made the suggestion because I remembered the the user-defined comparator,
and figured that a thrown exception would prevent any code, that
accidentally relied on args > 1 being silently ignored, from coming into
existence. So forget that, because you're right and this sucks:
var m;
try {
m = new Map(..., comparator);
} catch (e) {
m = new Map(...);
}
No thanks to that—I'd rather risk the rare cases in which args > 1 are
silently ignored and bugs hopefully caught by well written tests.
Rick
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss