Re: [[Call]] vs. [[Construct]] using symbols

2012-10-12 Thread Brendan Eich
Thanks, Tom. At this point, without a TC39 exception, even with unique symbols, I think this is a strawman (so ES7 at earliest). Anyone willing to write it up? /be Tom Van Cutsem wrote: I think we've been over this before. See the April thread callable objects? Brendan at that point also

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-12 Thread Herby Vojčík
Brendan Eich wrote: Thanks, Tom. At this point, without a TC39 exception, even with unique symbols, I think this is a strawman (so ES7 at earliest). Anyone willing to write it up? As a generic callable objects proposal, yes. But I am still saying there is a max-min proposal, which only

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-09 Thread Herby Vojčík
Dmitry Soshnikov wrote: What I thought though -- why do we need @call at all in this semantics? I'd rather disallowed calling classes at all at semantics level (aren't this only to cover this problem use-case with if (!(this instanceof Foo)) ?). If to reflect the behavior of embedded classes

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-09 Thread Herby Vojčík
Dmitry Soshnikov wrote: Though, that's said, then we'll have several the same semantically entities (proxies, unstratified traps, Object.observe) with different approaches. And it's better to reduce them. I like unstratified @private hooks. Don't see the reason why should I use Proxy in this

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-08 Thread Herby Vojčík
Kevin Smith wrote: It addresses a common pattern today, that looks like: function Led( opts ) { if ( !(this instanceof Led) ) { return new Led( opts ); } // ... } Yes - I explored this idea back when we were discussing classes several months ago.

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-08 Thread Herby Vojčík
Dmitry Soshnikov wrote: FWIW, we'd better stick with some reduced number of methods for meta-traps. As it turns out, we already have several different techniques which solve nearly the same problems: - Proxies, - Object.observe - Unstratified proposals like this one (which BTW, have been

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-08 Thread Herby Vojčík
Herby Vojčík wrote: Dmitry Soshnikov wrote: FWIW, we'd better stick with some reduced number of methods for meta-traps. As it turns out, we already have several different techniques which solve nearly the same problems: - Proxies, - Object.observe - Unstratified proposals like this one

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-08 Thread Dmitry Soshnikov
On Mon, Oct 8, 2012 at 1:04 AM, Herby Vojčík he...@mailbox.sk wrote: Dmitry Soshnikov wrote: FWIW, we'd better stick with some reduced number of methods for meta-traps. As it turns out, we already have several different techniques which solve nearly the same problems: - Proxies, -

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-08 Thread Tom Van Cutsem
I think we've been over this before. See the April thread callable objects? Brendan at that point also proposed to use private names (we didn't then have the distinction between private and unique symbols): https://mail.mozilla.org/pipermail/es-discuss/2012-April/022368.html I don't see any

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-08 Thread Herby Vojčík
Dmitry Soshnikov wrote: On Mon, Oct 8, 2012 at 1:04 AM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk wrote: Dmitry Soshnikov wrote: Notice though, that class's constructor(...) method (or @construct as you propose) does not reflect [[Construct]]. The constructor method is

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-08 Thread Dmitry Soshnikov
On Mon, Oct 8, 2012 at 1:20 PM, Herby Vojčík he...@mailbox.sk wrote: Dmitry Soshnikov wrote: On Mon, Oct 8, 2012 at 1:04 AM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk wrote: Dmitry Soshnikov wrote: Notice though, that class's constructor(...) method (or @construct as

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-07 Thread Herby Vojčík
Brendan Eich wrote: Before we add more unstratified traps, I'd like Tom and Mark to comment. They've thought a lot about invariants to preserve even with proxies in the picture, and also for non-proxies. And they have a use-case to test against: SES. Herby Vojčík wrote: But this has some

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-07 Thread Rick Waldron
On Sun, Oct 7, 2012 at 5:10 AM, Herby Vojčík he...@mailbox.sk wrote: Brendan Eich wrote: Before we add more unstratified traps, I'd like Tom and Mark to comment. They've thought a lot about invariants to preserve even with proxies in the picture, and also for non-proxies. And they have a

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-07 Thread Kevin Smith
It addresses a common pattern today, that looks like: function Led( opts ) { if ( !(this instanceof Led) ) { return new Led( opts ); } // ... } Yes - I explored this idea back when we were discussing classes several months ago. The thing that you have to consider is that

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-07 Thread Dmitry Soshnikov
FWIW, we'd better stick with some reduced number of methods for meta-traps. As it turns out, we already have several different techniques which solve nearly the same problems: - Proxies, - Object.observe - Unstratified proposals like this one (which BTW, have been already discussed many times;

Re: [[Call]] vs. [[Construct]] using symbols

2012-10-06 Thread Brendan Eich
Before we add more unstratified traps, I'd like Tom and Mark to comment. They've thought a lot about invariants to preserve even with proxies in the picture, and also for non-proxies. And they have a use-case to test against: SES. Herby Vojčík wrote: But this has some quirks to solve, like

[[Call]] vs. [[Construct]] using symbols

2012-10-03 Thread Herby Vojčík
Hello, now that we have symbols (and use some of them language-wise, like @iterator or proposed @toStringTag), I'd say we can probably dissect [[Call]] and [[Construct]] semantics fairly easily. Assuming there are global constant symbols @construct and @call, for min-max classes the issue is