ES4 draft LAST CALL: Map

David Teller david.teller at
Fri Mar 21 03:26:08 PDT 2008

I have a question related to collections in general.

I have the impression that ES4 will someday accept some kind of high-level concurrency, possibly Erlang-style. If so, we will probably need the ability to perform some kind of (destructive) pattern-matching/switch-type on the contents of a collection. Now, maybe this kind of pattern-matching will only needed for some concurrency-specific data structure, say a dynamically-typed Mailbox (à la Erlang) or a statically-typed Channel (à la Concurrent ML) or perhaps something higher-level (à la JoCaml).

With the current definition of Map and collections, this form of pattern-matching may probably be hand-coded using an iterator and intrinsic::remove, although the process is relatively unfriendly and the thread-safety will remain uncertain until there's a concurrency model for ES4.

Now, on to my question: should we add a method for finding some data in a collection from destructive pattern-matching or should this be left for later ?


Quoting Lars Hansen <lhansen at>:

> Last call for comments.  Minor changes since previous drafts (and some
> comments at the beginning to address changes that are known to come).
> --lars

More information about the Es4-discuss mailing list