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
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
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
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
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.
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
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
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,
-
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
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
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
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
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
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
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;
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
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
17 matches
Mail list logo