Re: Array method ranges

2013-01-24 Thread Brandon Benvie
It looks like the beginnings of an outline were added to the standard modules list living under '@iter' with zip and unzip so far: http://wiki.ecmascript.org/doku.php?id=harmony:modules_standard. But no separate strawman yet. On Thursday, January 24, 2013, Brendan Eich wrote: > Yes, this was the

Re: Array method ranges

2013-01-24 Thread Brendan Eich
Yes, this was the plan. I don't see a strawman, yet. Cc'ing jorendorff. /be Erik Arvidsson wrote: At this point I think we are better of moving towards iterator methods. For example if we had an islice like the one in Python's itertools [*] we can do: for (let v of islice(arr, start, stop)) {

Re: Ducks, Rabbits, and Privacy

2013-01-24 Thread Brendan Eich
Benoit Marchant wrote: Isn't it possible internally to allow a property access only by "this" ? No. For one thing, the design has to include class-private instance variables, not instance-private, so you need other.foo as well as this.foo (consider private x and y for Point2D add method). A

Re: Ducks, Rabbits, and Privacy

2013-01-24 Thread Kevin Smith
> Isn't it possible internally to allow a property access only by "this" ? > Ah-hem: priv(this).anyPropertyYouWantPlaya; : ) Using the definition of "priv" from previous messages is this thread. { Kevin } ___ es-discuss mailing list es-discuss@mo

Re: Ducks, Rabbits, and Privacy

2013-01-24 Thread Benoit Marchant
Thanks Brendan, that make sense but that's more than what I think I'm looking for. What I'm looking for is a way to store a value in a object's property that can only be accessed from a property access stand point by the object itself. My only goal is to make sure that outside code can't break e

Re: Ducks, Rabbits, and Privacy

2013-01-24 Thread Brendan Eich
Benoit Marchant wrote: I guess I don't quite understand why it seems contentious to add a "private" property to property descriptors which already "reserve" properties like "value", "enumerable" or "writable". "private" is a meta description of a property like "value", "enumerable" or "writab

Re: Ducks, Rabbits, and Privacy

2013-01-24 Thread Benoit Marchant
On Jan 24, 2013, at 5:47, Kevin Smith wrote: > >> Why would you use a square bracket notation rather than a . Property access >> notation? >> >> [] is typically only use when the property name is in a variable, which is >> not the case when you write your own object. > > True - but for sym

Re: Array method ranges

2013-01-24 Thread Erik Arvidsson
At this point I think we are better of moving towards iterator methods. For example if we had an islice like the one in Python's itertools [*] we can do: for (let v of islice(arr, start, stop)) { ... } this would be equivalent to your proposed arr.forEach((v) => { ... }, undefined, start, stop

Re: Private symbols auto-unwrapping proxies (was: Security Demands Simplicity (was: Private Slots))

2013-01-24 Thread Brandon Benvie
Just to clarify, the example I gave of WeakMap usage breaking with proxies was just to illustrate how a type of private data currently in use alongside proxies can break the target object purely by accident. While I do think [[CallMethod]] would go a long way to ameliorating the problem, I still be

RE: Array method ranges

2013-01-24 Thread François REMY
Good idea. However, I don't like the fact "arr.forEach(f,null,-1,0)" doesn't walk the array backwards properly. Not sure it's worth to have it built-in though. > Date: Thu, 24 Jan 2013 12:06:23 +0100 > Subject: Array method ranges > From: e...@qfox.nl > T

Re: Ducks, Rabbits, and Privacy

2013-01-24 Thread Kevin Smith
> Why would you use a square bracket notation rather than a . Property > access notation? > > [] is typically only use when the property name is in a variable, which is > not the case when you write your own object. > True - but for symbols, your only option is square brackets: var sym = new

Array method ranges

2013-01-24 Thread Peter van der Zee
What about adding specific range arguments to the es5 array methods (forEach, map, etc)? Currently the start (inclusive) and stop (exclusive) is always 0 ... length, but what if you only want to map over a sub range of the array? Or maybe I want to traverse the array in reverse? I'd either have to

Re: Private symbols auto-unwrapping proxies (was: Security Demands Simplicity

2013-01-24 Thread David Bruant
Le 22/01/2013 21:09, David Bruant a écrit : Le 22/01/2013 20:05, Tom Van Cutsem a écrit : Symbol-keyed indexing on the A face is distinct from symbol-keyed indexing on the B face. But that's OK: it's the job of the membrane to separate the A and the B face in the first place. I don't think that

Re: Private symbols auto-unwrapping proxies (was: Security Demands Simplicity (was: Private Slots))

2013-01-24 Thread David Bruant
Le 24/01/2013 09:52, Tom Van Cutsem a écrit : 2013/1/23 David Bruant mailto:bruan...@gmail.com>> Le 23/01/2013 09:38, Tom Van Cutsem a écrit : 3) because of JS's "invoke = get + apply" semantics, by default a proxy always leaves the |this| value pointing at the proxy

Re: Private symbols auto-unwrapping proxies (was: Security Demands Simplicity (was: Private Slots))

2013-01-24 Thread Tom Van Cutsem
2013/1/23 David Bruant > Le 23/01/2013 09:38, Tom Van Cutsem a écrit : > >> 3) because of JS's "invoke = get + apply" semantics, by default a proxy >> always leaves the |this| value pointing at the proxy. >> >> Looking only at 3), sometimes this is what you want, and sometimes it >> isn't. >> > I

Re: WeakMap GC performance

2013-01-24 Thread David Bruant
After email exchanged with Andreas, it seems that some emails clients (most modern ones?) do not work well when changing the email title; something I hadn't noticed on my own email client. I apologize for the inconvenience to anyone it has bothered and will fork thread less often from now on.

Re: Solving the "how do I tell whether I have an HTML element?" (or image element, or whatever) problem

2013-01-24 Thread Tom Van Cutsem
2013/1/24 Cameron McCormack > On 18/01/13 9:09 AM, Travis Leithead wrote: > >> I think this sounds fine. Most web developers don't expect the >> current spec'd behavior, even though to me it seems more natural. >> >> IE has the current behavior and I expect we would migrate to the new >> behavior

Re: Solving the "how do I tell whether I have an HTML element?" (or image element, or whatever) problem

2013-01-24 Thread Cameron McCormack
On 18/01/13 9:09 AM, Travis Leithead wrote: I think this sounds fine. Most web developers don't expect the current spec'd behavior, even though to me it seems more natural. IE has the current behavior and I expect we would migrate to the new behavior at some point once it was defined and agreed