My initial reaction: - Hosting getPrivate/setPrivate on Object seems quite strange to me. - it seems unrealistic to me to ask developers to write so much code every time they want to use their own private instance variable. The notion of Private should be specified once for an instance variable, not every time it's used internally - I haven't followed the whole thread and I'm not a language developer. I never felt that I needed a private data structure to hold internal "stuff". One can already do that with a closure and a WeakMap manually if one really wants it - I do want private instance variables that allow me to truly have encapsulation.
Thanks, Benoit On Jan 22, 2013, at 19:28, Kevin Smith <[email protected]> wrote: > A Duck/Rabbit Proposal: > > 1) There is only one kind of Symbol > 2) Private data can be accessed via Object.getPrivate and Object.setPrivate > > The goal is to provide a base-level API from which higher-level abstractions > can be built. > > // === Basic example === > var symbol = new Symbol(), obj = {}; > > // Setting private data: > Object.setPrivate(obj, symbol, {}); > > // Getting private data: > var data = Object.getPrivate(obj, symbol); > > Note that this does not preclude the possibility of full private symbols in > ES7. > > More at: > > https://gist.github.com/4601469 > > { Kevin } > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

