'stream' values

2015-05-06 Thread Mohan.Radhakrishnan
Hi, Can I stream values and operate on them like this ? I have a map and I would like to stream them. I also want to chain the functions. So, for example, I may sort the map's values and pass them on. map.entries((e,m) = sort by using a predicate ).foreach(manipulate the map's values);

Re: 'stream' values

2015-05-06 Thread Mark Volkmann
The entries method of a Map doesn't take a function. It does return an array though. That array contains [key, value] arrays. So you could do this. map.entries().sort(([k1, v1], [k2, v2]) = k1.localeCompare(k2)).forEach(([k, v]) = do-something); --- R. Mark Volkmann Object Computing, Inc. On

RE: 'stream' values

2015-05-06 Thread Mohan.Radhakrishnan
That line matches my Java code almost exactly. My traceur transpiler though throws ‘TypeError: map.entries(...).sort is not a function’. Should I switch the traspiler ? Thanks, Mohan From: Mark Volkmann [mailto:r.mark.volkm...@gmail.com] Sent: Wednesday, May 06, 2015 4:19 PM To: Radhakrishnan,

Detached TypedArray access semantics

2015-05-06 Thread Daniel Ehrenberg
In the draft ES6 spec, getting or setting array indices on detached TypedArrays raises a TypeError. However, both V8 and SpiderMonkey seem to return undefined from reads and silently succeed on writes. These semantics have probably been shipping for some time. As an implementer, I'm not sure what

Re: 'stream' values

2015-05-06 Thread Erik Arvidsson
entries() returns an iterator. To sort you need to convert to an array first. let a = [...map.entries()]; a.sort() On Wed, May 6, 2015, 08:37 mohan.radhakrish...@cognizant.com wrote: That line matches my Java code almost exactly. My traceur transpiler though throws ‘TypeError:

Re: Detached TypedArray access semantics

2015-05-06 Thread Brendan Eich
Allen Wirfs-Brock wrote: On May 6, 2015, at 7:36 AM, Daniel Ehrenberg wrote: In the draft ES6 spec, getting or setting array indices on detached TypedArrays raises a TypeError. However, both V8 and SpiderMonkey seem to return undefined from reads and silently succeed on writes. These

Re: Detached TypedArray access semantics

2015-05-06 Thread Allen Wirfs-Brock
On May 6, 2015, at 7:36 AM, Daniel Ehrenberg wrote: In the draft ES6 spec, getting or setting array indices on detached TypedArrays raises a TypeError. However, both V8 and SpiderMonkey seem to return undefined from reads and silently succeed on writes. These semantics have probably been