Re: Alternative syntax for <|

2011-11-25 Thread Claus Reinke
Recently Claus Reinke proposed some alternative that I think feels is so much more natural and simpler than <| or beget: .. .. re-interpretation deleted .. Ahem;-) Glad to see my proposal noticed, but what I really suggested, in motivating <| as structure representation, not operator https:

Re: Alternative syntax for <|

2011-11-22 Thread Allen Wirfs-Brock
On Nov 22, 2011, at 10:54 AM, Bob Nystrom wrote: > > On Tue, Nov 22, 2011 at 10:41 AM, Brendan Eich wrote: > > Nothing there about arrays or regular expressions, and the function examples > do *not* show anything like > > superFun <| function (...) {...} > > Instead of Ahem'ing, could you

Re: Alternative syntax for <|

2011-11-22 Thread Quildreen Motta
2011/11/22 Bob Nystrom > > On Tue, Nov 22, 2011 at 10:41 AM, Brendan Eich wrote: > >> >> Nothing there about arrays or regular expressions, and the function >> examples do *not* show anything like >> >> superFun <| function (...) {...} >> >> Instead of Ahem'ing, could you cite what you claim is

Re: Alternative syntax for <|

2011-11-22 Thread Bob Nystrom
On Tue, Nov 22, 2011 at 10:41 AM, Brendan Eich wrote: > > Nothing there about arrays or regular expressions, and the function > examples do *not* show anything like > > superFun <| function (...) {...} > > Instead of Ahem'ing, could you cite what you claim is a prior proposal > with specifics sh

Re: Alternative syntax for <|

2011-11-22 Thread Brendan Eich
On Nov 22, 2011, at 9:48 AM, Claus Reinke wrote: >>> Recently Claus Reinke proposed some alternative that I think feels is so >>> much more natural and simpler than <| or beget: >>> .. >>> .. re-interpretation deleted .. > > Ahem;-) Glad to see my proposal noticed, but what I really > suggested,

Re: Alternative syntax for <|

2011-11-22 Thread Claus Reinke
Recently Claus Reinke proposed some alternative that I think feels is so much more natural and simpler than <| or beget: .. .. re-interpretation deleted .. Ahem;-) Glad to see my proposal noticed, but what I really suggested, in motivating <| as structure representation, not operator htt

Re: Alternative syntax for <|

2011-11-22 Thread Dmitry Soshnikov
On 22.11.2011 5:55, Irakli Gozalishvili wrote: Recently Claus Reinke proposed some alternative that I think feels is so much more natural and simpler than <| or beget: Yes, it was proposed long time ago: https://mail.mozilla.org/pipermail/es-discuss/2011-May/014391.html let foo = {x: 10};

Re: Alternative syntax for <|

2011-11-21 Thread Brendan Eich
On Nov 21, 2011, at 5:55 PM, Irakli Gozalishvili wrote: > Recently Claus Reinke proposed some alternative that I think feels is so much > more natural and simpler than <| or beget: > > Instead of this: > > foo <| { bar: 'bar' } > > prototype can be a special property: > > { prototype: foo, ba

Re: Alternative syntax for <|

2011-11-21 Thread Irakli Gozalishvili
Recently Claus Reinke proposed some alternative that I think feels is so much more natural and simpler than <| or beget: Instead of this: foo <| { bar: 'bar' } prototype can be a special property: { prototype: foo, bar: 'bar' } simple and easy, of course it can have a different name from `p

Re: Alternative syntax for <|

2011-11-21 Thread Allen Wirfs-Brock
On Nov 19, 2011, at 11:38 AM, Dean Landolt wrote: > > > On Sat, Nov 19, 2011 at 1:57 PM, Allen Wirfs-Brock > wrote: > > On Nov 15, 2011, at 10:27 PM, Russell Leggett wrote: > > > > > > > but given the overall disapproval of the exact syntax of the <| operator, I > > think its at least a li

Re: Alternative syntax for <|

2011-11-19 Thread John J Barton
On Sat, Nov 19, 2011 at 11:07 AM, Allen Wirfs-Brock wrote: > > On Nov 17, 2011, at 2:05 PM, David Herman wrote: > >> On Nov 17, 2011, at 10:17 AM, Jason Orendorff wrote: >> >>> I'm with Allen. If ES classes can contain any initialization code, I >>> think it should run in program order, interleave

Re: Alternative syntax for <|

2011-11-19 Thread Dean Landolt
On Sat, Nov 19, 2011 at 1:57 PM, Allen Wirfs-Brock wrote: > > On Nov 15, 2011, at 10:27 PM, Russell Leggett wrote: > > > > > > > but given the overall disapproval of the exact syntax of the <| > operator, I think its at least a little more obvious what is going on. > > > > Sorry to be coming late

Re: Alternative syntax for <|

2011-11-19 Thread Allen Wirfs-Brock
On Nov 17, 2011, at 2:05 PM, David Herman wrote: > On Nov 17, 2011, at 10:17 AM, Jason Orendorff wrote: > >> I'm with Allen. If ES classes can contain any initialization code, I >> think it should run in program order, interleaved with top-level >> statements. Anything else is just confusing. >

Re: Alternative syntax for <|

2011-11-19 Thread Allen Wirfs-Brock
On Nov 15, 2011, at 10:27 PM, Russell Leggett wrote: > > > but given the overall disapproval of the exact syntax of the <| operator, I > think its at least a little more obvious what is going on. > Sorry to be coming late to this thread. I think the above statement is a false characteri

Re: Alternative syntax for <|

2011-11-17 Thread David Herman
On Nov 17, 2011, at 10:17 AM, Jason Orendorff wrote: > I'm with Allen. If ES classes can contain any initialization code, I > think it should run in program order, interleaved with top-level > statements. Anything else is just confusing. This is a great point, which I'd overlooked (not sure if Al

Re: Alternative syntax for <|

2011-11-17 Thread Russell Leggett
> > It is also something that my proposed version of the class operator could > do, because it always creates a function, and could desugar to the same > semantics as the current function style. > > > This may seem like a nit-pick, but I think it's not: any variant that sits > at statement context

Re: Alternative syntax for <|

2011-11-17 Thread Brendan Eich
On Nov 17, 2011, at 1:34 PM, Russell Leggett wrote: > On Thu, Nov 17, 2011 at 3:06 PM, David Flanagan wrote: > On 11/16/11 11:45 AM, Erik Arvidsson wrote: >> >> Sorry for being too brief. Today the following works. >> >> f(); >> ... >> function f() { ... } >> >> but the following does not: >>

Re: Alternative syntax for <|

2011-11-17 Thread Russell Leggett
On Thu, Nov 17, 2011 at 3:06 PM, David Flanagan wrote: > On 11/16/11 11:45 AM, Erik Arvidsson wrote: > > Sorry for being too brief. Today the following works. > > f(); > ... > function f() { ... } > > but the following does not: > > f(); > ... > let f = function f() {}; > > I think it is importan

Re: Alternative syntax for <|

2011-11-17 Thread Brendan Eich
On Nov 17, 2011, at 10:17 AM, Jason Orendorff wrote: > On Thu, Nov 17, 2011 at 10:40 AM, David Herman wrote: >> This isn't about scope, it's about at what point they're initialized. If you >> write: >> >>let x = new C(); >>let C = class /* whatever */; >> >> you won't get a scope error

Re: Alternative syntax for <|

2011-11-17 Thread David Flanagan
On 11/16/11 11:45 AM, Erik Arvidsson wrote: Sorry for being too brief. Today the following works. f(); ... function f() { ... } but the following does not: f(); ... let f = function f() {}; I think it is important that we keep the forward reference behavior with classes. This requires a decla

Re: Alternative syntax for <|

2011-11-17 Thread Jason Orendorff
On Thu, Nov 17, 2011 at 10:40 AM, David Herman wrote: > This isn't about scope, it's about at what point they're initialized. If you > write: > >    let x = new C(); >    let C = class /* whatever */; > > you won't get a scope error but a runtime initialization error. Whereas if > you write: > >

Re: Alternative syntax for <|

2011-11-17 Thread David Herman
On Nov 17, 2011, at 8:00 AM, Jason Orendorff wrote: > On Wed, Nov 16, 2011 at 1:12 PM, Erik Arvidsson > wrote: >> One thing that all of these discussions are missing is the hoisting >> property of function and any possible future classes. If we use "let >> Point = ..." we lose all hoisting and th

Re: Alternative syntax for <|

2011-11-17 Thread Jason Orendorff
On Wed, Nov 16, 2011 at 1:12 PM, Erik Arvidsson wrote: > One thing that all of these discussions are missing is the hoisting > property of function and any possible future classes. If we use "let > Point = ..." we lose all hoisting and the order of your declarations > starts to matter and we will

Re: Alternative syntax for <|

2011-11-17 Thread Greg Smith
The biggest advantage to beget is that it has the opportunity to become The Prototype Word. "inherit" has a lot of people associating it with classical OO programming. As nice as inherit sounds, it might be good to drop that baggage. -Greg On Wed, Nov 16, 2011 at 2:31 PM, Rick Waldron wrote: > A

Re: Alternative syntax for <|

2011-11-16 Thread Brendan Eich
On Nov 16, 2011, at 9:31 PM, David Herman wrote: > On Nov 16, 2011, at 12:11 PM, Dmitry Soshnikov wrote: > >> Yes, I understand, but it doesn't answer the question -- why do we need >> _additional_ keyword > > Infix operators can be conditional keywords. That's the current plan for is, > IINM.

Re: Alternative syntax for <|

2011-11-16 Thread David Herman
On Nov 16, 2011, at 12:11 PM, Dmitry Soshnikov wrote: > Yes, I understand, but it doesn't answer the question -- why do we need > _additional_ keyword Infix operators can be conditional keywords. That's the current plan for is, IINM. Dave ___ es-dis

Re: Alternative syntax for <|

2011-11-16 Thread Brendan Eich
On Nov 16, 2011, at 11:12 AM, Erik Arvidsson wrote: > One thing that all of these discussions are missing is the hoisting > property of function and any possible future classes. If we use "let > Point = ..." we lose all hoisting and the order of your declarations > starts to matter and we will end

Re: Alternative syntax for <|

2011-11-16 Thread Brendan Eich
On Nov 16, 2011, at 8:19 AM, Russell Leggett wrote: > On Wed, Nov 16, 2011 at 11:07 AM, Jake Verbaten wrote: > It's simply that > > var x = someProto beget { ... } > > reads nicer then > > var x = someProto extends { ... } > > I'd prefer to have readability on the non class related operator

Re: Alternative syntax for <|

2011-11-16 Thread Russell Leggett
On Wed, Nov 16, 2011 at 3:11 PM, Dmitry Soshnikov < dmitry.soshni...@gmail.com> wrote: > ** > On 16.11.2011 23:53, Rick Waldron wrote: > > > > On Wed, Nov 16, 2011 at 2:34 PM, Dmitry Soshnikov < > dmitry.soshni...@gmail.com> wrote: > >> But why do we need new keyword? >> > > The discussion origin

Re: Alternative syntax for <|

2011-11-16 Thread Dmitry Soshnikov
On 16.11.2011 23:53, Rick Waldron wrote: On Wed, Nov 16, 2011 at 2:34 PM, Dmitry Soshnikov mailto:dmitry.soshni...@gmail.com>> wrote: But why do we need new keyword? The discussion originated around how ugly <| is; an infix operator keyword is easier to introduce into the language the

Re: Alternative syntax for <|

2011-11-16 Thread Rick Waldron
On Wed, Nov 16, 2011 at 2:34 PM, Dmitry Soshnikov < dmitry.soshni...@gmail.com> wrote: > But why do we need new keyword? > The discussion originated around how ugly <| is; an infix operator keyword is easier to introduce into the language then an infix operator made of symbols > > Actually, I

Re: Alternative syntax for <|

2011-11-16 Thread Andreas Rossberg
On 16 November 2011 20:45, Erik Arvidsson wrote: > Sorry for being too brief. Today the following works. > > f(); > ... > function f() { ... } > > but the following does not: > > f(); > ... > let f = function f() {}; > > I think it is important that we keep the forward reference behavior > with cl

Re: Alternative syntax for <|

2011-11-16 Thread Erik Arvidsson
On Wed, Nov 16, 2011 at 11:29, Andreas Rossberg wrote: > On 16 November 2011 20:12, Erik Arvidsson wrote: >> One thing that all of these discussions are missing is the hoisting >> property of function and any possible future classes. If we use "let >> Point = ..." we lose all hoisting and the ord

Re: Alternative syntax for <|

2011-11-16 Thread Dmitry Soshnikov
But why do we need new keyword? Actually, I can accept a new keyword in case if reasons will really be serious. But in this case -- `extends' may fit quite nice. P.S.: In general, it's just funny picture. Somehow ES4 made nice classes with nice syntax. Why (Why Y NO?) now we invent some scary

Re: Alternative syntax for <|

2011-11-16 Thread Rick Waldron
As stated previously[1], my support for "begets" as pure win is unwavering. Rick [1] https://mail.mozilla.org/pipermail/es-discuss/2011-October/017758.html On Wed, Nov 16, 2011 at 2:16 PM, Dmitry Soshnikov < dmitry.soshni...@gmail.com> wrote: > On 16.11.2011 23:12, Erik Arvidsson wrote: > >

Re: Alternative syntax for <|

2011-11-16 Thread Andreas Rossberg
On 16 November 2011 20:12, Erik Arvidsson wrote: > One thing that all of these discussions are missing is the hoisting > property of function and any possible future classes. If we use "let > Point = ..." we lose all hoisting and the order of your declarations > starts to matter and we will end up

Re: Fwd: Alternative syntax for <|

2011-11-16 Thread Dmitry Soshnikov
On 16.11.2011 23:19, Quildreen Motta wrote: But with `var', only the declaration is hoisted, the actual assignment is not. Such that: var point3d = extends point { z: 1 } var point = { x: 1, y : 1 } Right, but I used declarative form, w/o assignment: var point3d extends point { z: 1} OTOH

Fwd: Alternative syntax for <|

2011-11-16 Thread Quildreen Motta
But with `var', only the declaration is hoisted, the actual assignment is not. Such that: var point3d = extends point { z: 1 } var point = { x: 1, y : 1 } Would still fail, as far as I know, whereas: class point3d extends point { z: 1 } class point { x: 1, y: 1 } Should work, if class is hoiste

Re: Alternative syntax for <|

2011-11-16 Thread Dmitry Soshnikov
On 16.11.2011 23:12, Erik Arvidsson wrote: One thing that all of these discussions are missing is the hoisting property of function and any possible future classes. If we use "let Point = ..." we lose all hoisting and the order of your declarations starts to matter and we will end up in the C mes

Re: Alternative syntax for <|

2011-11-16 Thread Erik Arvidsson
One thing that all of these discussions are missing is the hoisting property of function and any possible future classes. If we use "let Point = ..." we lose all hoisting and the order of your declarations starts to matter and we will end up in the C mess where forward references do not work. --

Re: Alternative syntax for <|

2011-11-16 Thread Russell Leggett
On Wed, Nov 16, 2011 at 11:07 AM, Jake Verbaten wrote: > It's simply that > > var x = someProto beget { ... } > > reads nicer then > > var x = someProto extends { ... } > > I'd prefer to have readability on the non class related operator then the > class related operator > I was actually suggest

Re: Alternative syntax for <|

2011-11-16 Thread Jake Verbaten
It's simply that var x = someProto beget { ... } reads nicer then var x = someProto extends { ... } I'd prefer to have readability on the non class related operator then the class related operator On Wed, Nov 16, 2011 at 3:45 PM, Russell Leggett wrote: > On Wed, Nov 16, 2011 at 10:31 AM, Jake

Re: Alternative syntax for <|

2011-11-16 Thread Russell Leggett
On Wed, Nov 16, 2011 at 10:31 AM, Jake Verbaten wrote: > I think there was a naming discussion in another thread. > > Popular alternatives seemed to be "beget" and "proto"/"protos". I still > seem to like "beget" > The reason I suggest it is *entirely* based on its relation to the potential clas

Re: Alternative syntax for <|

2011-11-16 Thread Jake Verbaten
I think there was a naming discussion in another thread. Popular alternatives seemed to be "beget" and "proto"/"protos". I still seem to like "beget" ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Alternative syntax for <|

2011-11-16 Thread Greg Smith
"How is it different from Object.create(...)? Actually yes, it's just an alternative and in contrast with O.create, I think here we may use not descriptors but directly values." The importance of this difference can't be understated. Object.create's verbosity makes it a poor idiom for everyday pro

Re: Alternative syntax for <|

2011-11-16 Thread Russell Leggett
On Wed, Nov 16, 2011 at 4:42 AM, Dmitry Soshnikov < dmitry.soshni...@gmail.com> wrote: > On 16.11.2011 10:27, Russell Leggett wrote: > > Given the recent conversation about class as operator and its likely > composition with <|, I propose turning the syntax: > > *MemberExpression* <| *ProtoL

Re: Alternative syntax for <|

2011-11-16 Thread Dmitry Soshnikov
On 16.11.2011 10:27, Russell Leggett wrote: Given the recent conversation about class as operator and its likely composition with <|, I propose turning the syntax: /MemberExpression/ <| /ProtoLiteral/ into extends /MemberExpression ProtoLiteral/ In the common case of using the class operato

Alternative syntax for <|

2011-11-15 Thread Russell Leggett
Given the recent conversation about class as operator and its likely composition with <|, I propose turning the syntax: *MemberExpression* <| *ProtoLiteral* into extends *MemberExpression ProtoLiteral* In the common case of using the class operator, it would read much more naturally: