Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-20 Thread Dmitry A. Soshnikov
On 20.12.2010 1:16, Lasse Reichstein wrote: On Sun, 19 Dec 2010 22:19:25 +0100, Juriy Zaytsev kan...@gmail.com wrote: On Sun, Dec 19, 2010 at 7:21 AM, Lasse Reichstein reichsteinatw...@gmail.com wrote: Also, it provides a feature that ES5 doesn't yet: the ability to change an object's

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-20 Thread Peter van der Zee
On Mon, Dec 20, 2010 at 9:24 AM, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: On 20.12.2010 1:16, Lasse Reichstein wrote: On Sun, 19 Dec 2010 22:19:25 +0100, Juriy Zaytsev kan...@gmail.com wrote: On Sun, Dec 19, 2010 at 7:21 AM, Lasse Reichstein reichsteinatw...@gmail.com

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-20 Thread Dmitry A. Soshnikov
In addition here's Brendan's explanation of issues: https://mail.mozilla.org/pipermail/es-discuss/2010-April/010917.html On 20.12.2010 13:06, Dmitry A. Soshnikov wrote: On 20.12.2010 12:04, Peter van der Zee wrote: On Mon, Dec 20, 2010 at 9:24 AM, Dmitry A. Soshnikov

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-20 Thread Peter van der Zee
Really, I can't remember some _very_ needed use-case of exactly changing `__proto__` dynamically. First, yes, I'm analyze it from the theoretical design viewpoint. ECMAScript borrowed __proto__ from Python. It's called __class__ there -- and it's also mutable. Though, I also can't remember

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-20 Thread Lasse Reichstein
On Mon, 20 Dec 2010 09:24:12 +0100, Dmitry A. Soshnikov dmitry.soshni...@gmail.com wrote: On 20.12.2010 1:16, Lasse Reichstein wrote: [Mutalbe __proto__] It's there now, so performance won't be any worse than today. Personally, I think the cost of a mutable prototype is subsumed in the

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-19 Thread Lasse Reichstein
On Sun, 19 Dec 2010 08:39:00 +0100, Juriy Zaytsev kan...@gmail.com wrote: __proto__ also appears to be marked as deprecated in current version of corresponding MDN docs. I wouldn't be surprised to see it go soon (if that doesn't break web too much). I'm afraid I don't see it going away any

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-19 Thread Juriy Zaytsev
On Sun, Dec 19, 2010 at 7:21 AM, Lasse Reichstein reichsteinatw...@gmail.com wrote: On Sun, 19 Dec 2010 08:39:00 +0100, Juriy Zaytsev kan...@gmail.com wrote: __proto__ also appears to be marked as deprecated in current version of corresponding MDN docs. I wouldn't be surprised to see it go

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-19 Thread Asen Bozhilov
Juriy Zaytsev wrote: Is Brendan on this list? Unfortunately he is not at the list. I've sent invitation to him, be he hasn't replied yet. I hope he would join at the list. Also Douglas Crockford would accept and his invitation. -- To view archived discussions from the original JSMentors

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-19 Thread Lasse Reichstein
On Sun, 19 Dec 2010 22:19:25 +0100, Juriy Zaytsev kan...@gmail.com wrote: On Sun, Dec 19, 2010 at 7:21 AM, Lasse Reichstein reichsteinatw...@gmail.com wrote: Also, it provides a feature that ES5 doesn't yet: the ability to change an object's prototype chain. ES5 brought us

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-18 Thread Juriy Zaytsev
On Fri, Dec 17, 2010 at 8:43 PM, Asen Bozhilov asen.bozhi...@gmail.comwrote: Garrett Smith wrote: Juriy Zaytsev wrote: var beget = (function() { function F(){ }; All good except for the extra empty statement there. AYK, semicolon is not needed after the FD. Yes! Thanks for

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-17 Thread Asen Bozhilov
Garrett Smith wrote: Juriy Zaytsev wrote: var beget = (function() { function F(){ }; All good except for the extra empty statement there. AYK, semicolon is not needed after the FD. I guess this is typo according knowledge of Juriy. Anyway, more important is discussion about

Re: [JSMentors] Can I dynamically make a prototype link?

2010-12-17 Thread Garrett Smith
On 12/17/10, Asen Bozhilov asen.bozhi...@gmail.com wrote: Garrett Smith wrote: Juriy Zaytsev wrote: var beget = (function() { function F(){ }; All good except for the extra empty statement there. AYK, semicolon is not needed after the FD. (AYK means as you know.) I guess this is

[JSMentors] Can I dynamically make a prototype link?

2010-12-16 Thread Yu-Hsuan Lai
I read Good Parts, and it use Object#beget to implement prototypal inheritance. beget = function (o) { f = function () {}; f.prototype = o; return new f(); } a = {... object literal ...}; b = Object.beget(a); It can build a prototype link when a object is created. But if I want to