Re: Your search - | - did not match any documents

2011-10-14 Thread Jake Verbaten
The difference is that object.extend returns objects where as object.make returns things with the same type as the second operand. So object.extend (obj, someFunction) is easy. where as object.make(obj, someFunction) returns a function. Now clearly its a new function so it doesnt share closure

Re: Your search - | - did not match any documents

2011-10-14 Thread John J Barton
On Fri, Oct 14, 2011 at 12:56 AM, Jake Verbaten rayn...@gmail.com wrote: The difference is that object.extend returns objects where as object.make returns things with the same type as the second operand. So object.extend (obj, someFunction) is easy. where as object.make(obj, someFunction)

Re: Your search - | - did not match any documents

2011-10-14 Thread Brendan Eich
On Oct 14, 2011, at 10:45 AM, John J Barton wrote: On Fri, Oct 14, 2011 at 12:56 AM, Jake Verbaten rayn...@gmail.com wrote: The difference is that object.extend returns objects where as object.make returns things with the same type as the second operand. So object.extend (obj,

Re: Your search - | - did not match any documents

2011-10-14 Thread John J Barton
On Fri, Oct 14, 2011 at 8:46 AM, Brendan Eich bren...@mozilla.com wrote: On Oct 14, 2011, at 10:45 AM, John J Barton wrote: On Fri, Oct 14, 2011 at 12:56 AM, Jake Verbaten rayn...@gmail.com wrote: The difference is that object.extend returns objects where as object.make returns things with

Re: Your search - | - did not match any documents

2011-10-14 Thread Brendan Eich
On Oct 14, 2011, at 9:33 AM, John J Barton wrote: On Fri, Oct 14, 2011 at 8:46 AM, Brendan Eich bren...@mozilla.com wrote: On Oct 14, 2011, at 10:45 AM, John J Barton wrote: So for the path you are advocating, pure functions that make fresh objects, you need to specify cloning. That is a

Re: Your search - | - did not match any documents

2011-10-13 Thread Jake Verbaten
Whilst mentioning Object.createSimple, is there any plan for having matching functions for all this declaritive syntax? On Oct 13, 2011 8:17 AM, Jay Skeer j...@seanet.com wrote: ** On 10/12/2011 07:57 PM, John J Barton wrote: On Wed, Oct 12, 2011 at 5:52 PM, Allen Wirfs-Brock ... I agree, and

Re: Your search - | - did not match any documents

2011-10-13 Thread Brendan Eich
On Oct 13, 2011, at 3:59 AM, Jake Verbaten wrote: Whilst mentioning Object.createSimple, is there any plan for having matching functions for all this declaritive syntax? We do not want functions that mutate the [[Prototype]] internal property of existing objects. See

Re: Your search - | - did not match any documents

2011-10-13 Thread Dean Landolt
On Thu, Oct 13, 2011 at 12:08 PM, Brendan Eich bren...@mozilla.com wrote: On Oct 13, 2011, at 3:59 AM, Jake Verbaten wrote: Whilst mentioning Object.createSimple, is there any plan for having matching functions for all this declaritive syntax? We do not want functions that mutate the

Re: Your search - | - did not match any documents

2011-10-13 Thread Jake Verbaten
Could the problem of mutating the [[Prototype]] not be solved by returning a new object with the [[Prototype]] set as the LHS and having the same [[Class]] and own properties as the RHS. I would change the semantics slightly. The only forseeable issue is how to handle closures. On Thu, Oct 13,

Re: Your search - | - did not match any documents

2011-10-13 Thread Brendan Eich
On Oct 13, 2011, at 1:17 PM, Brendan Eich wrote: On Oct 13, 2011, at 12:43 PM, John J Barton wrote: But literal RHS makes the prototypeOverwrite operator | dramatically less useful and not JavaScripty. Nice assertions. First, mutable __proto__ is in four of five browsers and IE is

Re: Your search - | - did not match any documents

2011-10-13 Thread Allen Wirfs-Brock
On Oct 13, 2011, at 9:42 AM, Jake Verbaten wrote: Could the problem of mutating the [[Prototype]] not be solved by returning a new object with the [[Prototype]] set as the LHS and having the same [[Class]] and own properties as the RHS. I would change the semantics slightly. The only

Re: Your search - | - did not match any documents

2011-10-13 Thread John J Barton
On Thu, Oct 13, 2011 at 10:29 AM, Brendan Eich bren...@mozilla.com wrote: On Oct 13, 2011, at 1:17 PM, Brendan Eich wrote: ... Object.getPrototypeOf is the get API in ES5. For the preset API we want syntax at least, to avoid copying literals passed to a functional API. We could have the

Re: Your search - | - did not match any documents

2011-10-13 Thread Brendan Eich
On Oct 13, 2011, at 2:19 PM, John J Barton wrote: On Thu, Oct 13, 2011 at 10:29 AM, Brendan Eich bren...@mozilla.com wrote: On Oct 13, 2011, at 1:17 PM, Brendan Eich wrote: ... Object.getPrototypeOf is the get API in ES5. For the preset API we want syntax at least, to avoid copying

Re: Your search - | - did not match any documents

2011-10-13 Thread John J Barton
On Thu, Oct 13, 2011 at 11:51 AM, Brendan Eich bren...@mozilla.com wrote: On Oct 13, 2011, at 2:19 PM, John J Barton wrote: On Thu, Oct 13, 2011 at 10:29 AM, Brendan Eich bren...@mozilla.comwrote: On Oct 13, 2011, at 1:17 PM, Brendan Eich wrote: ... Object.getPrototypeOf is the get API

Re: Your search - | - did not match any documents

2011-10-13 Thread Dean Landolt
On Thu, Oct 13, 2011 at 3:13 PM, John J Barton johnjbar...@johnjbarton.comwrote: On Thu, Oct 13, 2011 at 11:51 AM, Brendan Eich bren...@mozilla.comwrote: On Oct 13, 2011, at 2:19 PM, John J Barton wrote: On Thu, Oct 13, 2011 at 10:29 AM, Brendan Eich bren...@mozilla.comwrote: On Oct 13,

Re: Your search - | - did not match any documents

2011-10-13 Thread Russell Leggett
[snip] I want to compose objects: var result = cookUpTheBehavior(goodies, stuff) | initializeTheState(args); You want something else, then. Just because you want B does not mean A is useless or less useful or not JavaScripty. With a decent Object.extend() we'd have a clean way to

Re: Your search - | - did not match any documents

2011-10-13 Thread Brendan Eich
On Oct 13, 2011, at 3:13 PM, John J Barton wrote: Darn, now I'm lost again. I would have said That's how | works :-( I would have said o2 = {p:27} | o1; // aka Object.make() No, | does not accept non-literal RHS forms. That's intentional and that's the whole difference. /be o2 is

Re: Your search - | - did not match any documents

2011-10-13 Thread John J Barton
On Thu, Oct 13, 2011 at 12:59 PM, Dean Landolt d...@deanlandolt.com wrote: On Thu, Oct 13, 2011 at 3:13 PM, John J Barton johnjbar...@johnjbarton.com wrote: On Thu, Oct 13, 2011 at 11:51 AM, Brendan Eich bren...@mozilla.comwrote: On Oct 13, 2011, at 2:19 PM, John J Barton wrote: On

Re: Your search - | - did not match any documents

2011-10-13 Thread Brendan Eich
On Oct 13, 2011, at 6:00 PM, John J Barton wrote: Simply stated, the triangle operator lets you set the prototype of an object if and only if that object has not yet been observably instantiated. It's a small tradeoff, but it gives us many of the benefits of mutable protos without the

Re: Your search - | - did not match any documents

2011-10-13 Thread John J Barton
On Thu, Oct 13, 2011 at 3:27 PM, Brendan Eich bren...@mozilla.com wrote: On Oct 13, 2011, at 6:00 PM, John J Barton wrote: Simply stated, the triangle operator lets you set the prototype of an object if and only if that object has not yet been observably instantiated. It's a small tradeoff,

Re: Your search - | - did not match any documents

2011-10-13 Thread Allen Wirfs-Brock
On Oct 13, 2011, at 3:55 PM, John J Barton wrote: Suppose for a moment we allowed objects on the RHS: var o3 = p | o2; Would we imagine that o2 was mutated in any way? I don't think so. Maybe there are binary ops that mutate operands, but they don't come to mind. So the entire

Re: Your search - | - did not match any documents

2011-10-13 Thread John J Barton
On Thu, Oct 13, 2011 at 4:26 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Oct 13, 2011, at 3:55 PM, John J Barton wrote: Suppose for a moment we allowed objects on the RHS: var o3 = p | o2; Would we imagine that o2 was mutated in any way? I don't think so. Maybe there are

Re: Your search - | - did not match any documents

2011-10-13 Thread Allen Wirfs-Brock
On Oct 13, 2011, at 5:08 PM, John J Barton wrote: On Thu, Oct 13, 2011 at 4:26 PM, Allen Wirfs-Brock al...@wirfs-brock.com wrote: I still haven't found a really compelling use case for a non-literal | RHS and a good definition for object cloning is still a nut to crack. But both

Re: Your search - | - did not match any documents

2011-10-13 Thread John J Barton
On Thu, Oct 13, 2011 at 6:08 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: On Oct 13, 2011, at 5:08 PM, John J Barton wrote: On Thu, Oct 13, 2011 at 4:26 PM, Allen Wirfs-Brock al...@wirfs-brock.comwrote: I still haven't found a really compelling use case for a non-literal | RHS

Re: Your search - | - did not match any documents

2011-10-12 Thread Allen Wirfs-Brock
The page you want is http://wiki.ecmascript.org/doku.php?id=harmony:proto_operator It suggests pronouncing it as prototype of. However, in most conversations I've been in we've called it triangle. the proposed operator symbol is | not | Allen On Oct 12, 2011, at 5:37 PM, John J Barton