Re: supporting ES upgrading with a programming pattern repo?

2011-11-09 Thread Axel Rauschmayer
process. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Fwd: supporting ES upgrading with a programming pattern repo?

2011-11-09 Thread Axel Rauschmayer
Osmany, Angus Croll, or Nicholas Zakas I know that there usually won’t be any errors. It might make sense for someone to curate the considerable introductory material that is out there. That could be complemented by a peer review process. -- Dr. Axel Rauschmayer a...@rauschma.de home

Re: for..in, hasOwnProperty(), and inheritance

2011-11-08 Thread Axel Rauschmayer
. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es

Re: for..in, hasOwnProperty(), and inheritance

2011-11-08 Thread Axel Rauschmayer
of tricky to know when to stop traversing the prototype chain, so the more straightforward solution is to make a copy and modify there or to non-destructively merge: https://developer.yahoo.com/yui/3/examples/yui/yui-merge.html -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter

Re: for own(...) loop (spin-off from Re: for..in, hasOwnProperty(), and inheritance)

2011-11-08 Thread Axel Rauschmayer
use a contextual keyword immediately after 'for': for own (i in o) { body } This is a small thing but it might pay off in the long run. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: for own(...) loop (spin-off from Re: for..in, hasOwnProperty(), and inheritance)

2011-11-08 Thread Axel Rauschmayer
Allen is proposing for [] to keep program domain and data domain separate. Then dicts can actually get a size() method. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing

Re: for own(...) loop (spin-off from Re: for..in, hasOwnProperty(), and inheritance)

2011-11-08 Thread Axel Rauschmayer
with “not interact badly” if there are indeed other use cases. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: An array destructing specification choice

2011-11-07 Thread Axel Rauschmayer
-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Are some es-discuss submissions automatically blocked?

2011-11-07 Thread Axel Rauschmayer
the blocking criteria is. Maybe an anti-spam trying to be smarter than it is? That would be my guess, too. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es

Re: An array destructing specification choice

2011-11-06 Thread Axel Rauschmayer
is syntactic sugar for x = rhs[0], y = rhs[1], z = rhs[2] -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Are some es-discuss submissions automatically blocked?

2011-11-06 Thread Axel Rauschmayer
Claus Reinke could not submit his js-tools discussion group announcement (interestingly, I could do it for him). And the email I appended underneath my signature never got through. Can someone explain the blocking criteria? Thanks! Axel -- Dr. Axel Rauschmayer a...@rauschma.de home

Re: An array destructing specification choice

2011-11-06 Thread Axel Rauschmayer
-- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: An array destructing specification choice

2011-11-06 Thread Axel Rauschmayer
, anyway. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: An array destructing specification choice

2011-11-05 Thread Axel Rauschmayer
@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: On class literals possibly not making it into ECMAScript.next

2011-11-04 Thread Axel Rauschmayer
() - Everything else here: jQuery.bar() -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-04 Thread Axel Rauschmayer
(stolenArray); } Bob(makeTable()); -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-04 Thread Axel Rauschmayer
distinguish between accessing a property and accessing a collection element. Then the former would be done via Object.* methods, while the latter would be done via square brackets. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-04 Thread Axel Rauschmayer
But hackedPush is added to the instance, not Array.prototype. On Nov 4, 2011, at 18:59 , Allen Wirfs-Brock wrote: On Nov 4, 2011, at 10:33 AM, Axel Rauschmayer wrote: How about: function Bob(t) { var stolenArray; var hackedPush = function() { stolenArray

Re: On class literals possibly not making it into ECMAScript.next

2011-11-04 Thread Axel Rauschmayer
methods here: jQuery().foo() - Everything else here: jQuery.bar() -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-04 Thread Axel Rauschmayer
. - Stricter mode could also restrict [] for arrays to just numbers, including negative numbers for accessing elements relative to the end of an array. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-04 Thread Axel Rauschmayer
email): - Never use objects as maps. - Introduce collection classes. - Try to make arrays fit into the collection framework. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss

Re: Lecture series on SES and capability-based security by Mark Miller

2011-11-04 Thread Axel Rauschmayer
() and Object.getProperty() when you want to compute the name of a property. - Stricter mode could also restrict [] for arrays to just numbers, including negative numbers for accessing elements relative to the end of an array. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de

Yet another class declaration proposal

2011-11-03 Thread Axel Rauschmayer
FWIW: I’ve picked what I like from the various proposals. https://gist.github.com/1336846 -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org

Re: Yet another class declaration proposal

2011-11-03 Thread Axel Rauschmayer
with class at all. Why not just have let Monster = Being | { ... } This way we don't introduce the class keyword which is confusing and loaded with assumptions about what it does and means. https://gist.github.com/1336846 -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de

Re: Yet another class declaration proposal

2011-11-03 Thread Axel Rauschmayer
with a pure class declaration. Fine with me, I don’t have any preference in this regard. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Globalization API working draft

2011-11-03 Thread Axel Rauschmayer
then on your clients don't have to change a thing. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

js-tools (mailing list for Javascript developer tools and tool development)

2011-11-03 Thread Axel Rauschmayer
[I’m sending this email for Claus Reinke, because when he sends it, es-discuss blocks it] There is a new mailing list for Javascript tool developers, intended to complement the es-discuss list's language design and specification topics: http://groups.google.com/group/js-tools Please see the

Re: Status of script loading in ecmascript

2011-11-03 Thread Axel Rauschmayer
://wiki.ecmascript.org/doku.php?id=harmony:modules What would you want to standardize? It would be great if Node.js adopted AMD, but at the very latest we’ll have a common standard via ES.next. Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Minimalist Classes

2011-11-02 Thread Axel Rauschmayer
, I mean. So one would want this.publicProp anyway. Between this consideration and the preference for private, I'm fine stopping with @ for private. I think the namespacing via this is a feature, it give the code a nice uniform look: if (this.foo === other.foo) Axel -- Dr. Axel

Re: Minimalist Classes

2011-11-02 Thread Axel Rauschmayer
with your proposal or a general problem? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Minimalist Classes

2011-11-02 Thread Axel Rauschmayer
of the other stuff you can even trivially get your minifier to desugar for older browsers. I don't think hard coding the name of the super-constructor is a problem. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Minimalist Classes

2011-11-02 Thread Axel Rauschmayer
other privacy needs I use naming conventions, but there are people who don’t like that): - Avoid name clashes (e.g. when mixing in a trait, but also when doing subtyping). - Enable special functionality. You could also use a naming convention here, but using a name object is nicer. -- Dr. Axel

Re: Minimalist Classes

2011-11-01 Thread Axel Rauschmayer
list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Minimalist Classes

2011-11-01 Thread Axel Rauschmayer
deeper than 2nd level super-calls, then even call-stack is not needed. See this implementation: https://gist.github.com/1330574#L68 (with delete-restore the parent link technique). Usage level with examples (line 95): https://gist.github.com/1330574#L95 -- Dr. Axel Rauschmayer a...@rauschma.de

Re: Minimalist Classes

2011-11-01 Thread Axel Rauschmayer
is the code. https://gist.github.com/1331748 -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: More thoughts on Allen’s class definition pattern

2011-10-31 Thread Axel Rauschmayer
argument against something grawlixy, though. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: More thoughts on Allen’s class definition pattern

2011-10-31 Thread Axel Rauschmayer
= Person to { ... } // or any other preposition (prepositions are like operators) const Employee = Person parents { ... } -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing

Re: More thoughts on Allen’s class definition pattern

2011-10-31 Thread Axel Rauschmayer
to it. let obj = base proto {a: 1, b: 2} let arr = base proto [p, q, r] let fun = base proto function (...args) { ... } let re = base proto /(\w+)\s+(\w)+/g -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: More thoughts on Allen’s class definition pattern

2011-10-31 Thread Axel Rauschmayer
”). If people manage to get over their class bias (which is hard, because we have been exposed to classes so much) then “begets” is a much more natural way of doing things, because you always directly work with and connect objects. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter

Re: More thoughts on Allen’s class definition pattern

2011-10-31 Thread Axel Rauschmayer
a combination of two easy words, so it shouldn’t be too hard to learn. I think it’s too late to remove the English bias from JavaScript (kudos to Oracle for trying – they call their JavaScript engine Nashorn). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com

Re: More thoughts on Allen’s class definition pattern

2011-10-31 Thread Axel Rauschmayer
Note that for many non-native English speakers probably don't have many of these words (including beget) in their vocabularies. For them, a symbolic token such as | or : is probably just as meaningful. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma

Re: More thoughts on Allen’s class definition pattern

2011-10-31 Thread Axel Rauschmayer
the same for “beget”? But “begets” isn’t any better. Maybe “begetting”? The result can indeed be described as Person begetting an object. Person beget { ... } = ??? Is beget an imperative here or an infinitive? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter

Re: More thoughts on Allen’s class definition pattern

2011-10-31 Thread Axel Rauschmayer
that the fact that it is not a verb disqualifies it. German has a word for it, my dictionary says the translation is “bequeath”. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing

Re: Minimalist Classes

2011-10-31 Thread Axel Rauschmayer
be replaced by any expression. What is your take on object exemplars? Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
are easier to understand. It’s the opposite: Always having to create a class to create an object is opposed to how humans think: You don’t start with the abstract, you start with the specific. Self has demonstrated very well that prototype-based inheritance can be very intuitive. -- Dr. Axel

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
” comparison). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
: { // methods } // class (ie, constructor) properties }; -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
the property name if it is the same as the current method name, but for now I always explicitly include the name. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
exemplars were to become part of ES.next, we would not need class literals. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
appeared to create issues for getter/setter property accesses: var p = sup | {get foo() { return super} //is this the same as return super.foo ??? }; Allen On Oct 30, 2011, at 12:54 PM, Axel Rauschmayer wrote: But we could have super(foo) as syntactic sugar

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
). Axel -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
+)\s+(\w)+/g A bit long, but reads nicely. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
{ ... } const Employee = Person parenting { ... } const Employee = Person above { ... } const Employee = Person before { ... } The above examples are almost English (well, to programmers, anyway). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
to produce an instance. I like object exemplar and function exemplar, because they are the more direct descriptions. On Oct 31, 2011, at 2:17 , Allen Wirfs-Brock wrote: On Oct 30, 2011, at 5:47 PM, Axel Rauschmayer wrote: Thanks. But it is function exemplar versus object exemplar

Re: More thoughts on Allen’s class definition pattern

2011-10-30 Thread Axel Rauschmayer
@mozilla.org https://mail.mozilla.org/listinfo/es-discuss -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: On class literals possibly not making it into ECMAScript.next

2011-10-29 Thread Axel Rauschmayer
to allow one to reimplement |super| (one use case that comes to my mind is implementing multiple dispatch in JavaScript). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list

Re: On class literals possibly not making it into ECMAScript.next

2011-10-29 Thread Axel Rauschmayer
= 3DPoint.prototype.isPositive; Entity.prototype.isPositive = function () { return this.hasPoint this._isPositive(); }; Entity.prototype.hasPoint = false; (new Entity).setPoint(1, 2, 3).isPositive(); // boom ? or super is bound to Point ? -- Dr. Axel Rauschmayer a...@rauschma.de home

Re: On class literals possibly not making it into ECMAScript.next

2011-10-29 Thread Axel Rauschmayer
overthinking classes? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

More thoughts on Allen’s class definition pattern

2011-10-29 Thread Axel Rauschmayer
*/): { //constructor body super(/*arguments to super constructor*/); this.{ //per instance property definitions }; }, prototype: { } //class (ie, constructor) properties }; -- Dr. Axel Rauschmayer a...@rauschma.de

Re: More thoughts on Allen’s class definition pattern

2011-10-29 Thread Axel Rauschmayer
*/); this.{ //per instance property definitions }; }.{ //class (ie, constructor) properties }.prototype{ // no dot after prototype //instance properties defined on prototype }; -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog

Re: On class literals possibly not making it into ECMAScript.next

2011-10-29 Thread Axel Rauschmayer
that the same mechanism can be used for “subclassing” and for creating an instance directly. Also, I think having super would help a lot. It seems to be a done deal for ES.next and is not tied to classes! -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog

Re: On class literals possibly not making it into ECMAScript.next

2011-10-29 Thread Axel Rauschmayer
are the one thing that would stay the same between all current proposals! -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: More thoughts on Allen’s class definition pattern

2011-10-29 Thread Axel Rauschmayer
that makes it easy to create them. Class literals and the various class definition patterns are all suitable candidates. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss

Re: testable specification

2011-10-28 Thread Axel Rauschmayer
Correct. My bad. -- Dr. Axel Rauschmayer rauschma.de [Sent from a mobile device, please forgive brevity and typos] On Oct 28, 2011, at 8:02, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Oct 27, 2011, at 3:08 AM, Axel Rauschmayer wrote: +1. Where the spec is already almost pseudo-code

On class literals possibly not making it into ECMAScript.next

2011-10-28 Thread Axel Rauschmayer
post] -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: testable specification

2011-10-27 Thread Axel Rauschmayer
. that could be used to test the algorithms. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: testable specification

2011-10-27 Thread Axel Rauschmayer
, I would in general be in favor of ES6, because it would help with implementing types (at the very least, subtyping would be easier via | ). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: testable specification

2011-10-27 Thread Axel Rauschmayer
. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: testable specification

2011-10-27 Thread Axel Rauschmayer
, yet and you want to start now? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Enums?

2011-10-25 Thread Axel Rauschmayer
On Oct 25, 2011, at 8:15 , Andrea Giammarchi wrote: I work on mobile browsers ... things are up to 1000 times slower there and all tricks, as long as still readable, are welcome in my daily basis work. Right, mobile is challenging. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de

Re: Enums?

2011-10-24 Thread Axel Rauschmayer
a toString method. Allen On Oct 3, 2011, at 2:28 AM, Axel Rauschmayer wrote: Nice one! It doesn’t even have to be Name.create() – new Object() works just fine. And you can use switch with this pattern (I ES5-ified the code): function Enum() { let e

Re: Enums?

2011-10-24 Thread Axel Rauschmayer
all these anonymous functions using the closure with declarations for Symbol and Enum and export once at the end rather than reference the exports object each time. Yes, good idea, it’ll make things easier to read. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter

Re: Enums?

2011-10-24 Thread Axel Rauschmayer
Ah, the array extras use pass the second argument on to Function.prototype.call. That would indeed be faster. I thought bind() was used, but that makes no sense. On Oct 25, 2011, at 0:23 , Brendan Eich wrote: On Oct 24, 2011, at 2:53 PM, Axel Rauschmayer wrote: that = this: - Your point

Re: Enums?

2011-10-24 Thread Axel Rauschmayer
Please consider this.enum break all minifiers since enum is a reserved word, I had to do this[enum] = {} at the end indeed. Is enums better than enum? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Terminology: types, constructors, classes, …

2011-10-23 Thread Axel Rauschmayer
. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Terminology: types, constructors, classes, …

2011-10-23 Thread Axel Rauschmayer
objects that are its instances. - A constructor inherits from another constructor. - A class is a subclass of another class. I wonder if the word class couldn’t be avoided (certainly not with class literals). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma

Re: Terminology: types, constructors, classes, …

2011-10-23 Thread Axel Rauschmayer
, Counter); -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Determining the super-types

2011-10-23 Thread Axel Rauschmayer
.prototype.isPrototypeOf(constr2.prototype); } -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Terminology: types, constructors, classes, …

2011-10-23 Thread Axel Rauschmayer
a helper for duck typing. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Terminology: types, constructors, classes, …

2011-10-23 Thread Axel Rauschmayer
from another one. I’m just looking for the right words to express what is happening in such a case. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss

Re: Terminology: types, constructors, classes, …

2011-10-23 Thread Axel Rauschmayer
. A.prototype is a prototype of B. prototype (ugh). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: Terminology: types, constructors, classes, …

2011-10-23 Thread Axel Rauschmayer
: I’ve implemented something similar to Selfish (using the method new was inspired by it): https://github.com/rauschma/proto-js -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss

Re: Terminology: types, constructors, classes, …

2011-10-23 Thread Axel Rauschmayer
Can you elaborate? It seems like a cultural reference, but I don’t get it. On Oct 24, 2011, at 0:18 , Brendan Eich wrote: Does no one read RPG's fine Clause 3 of ECMA-262 these days? -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Determining the super-types

2011-10-22 Thread Axel Rauschmayer
of handling inheritance in ES. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Protocol for new and instanceof?

2011-10-21 Thread Axel Rauschmayer
) { let inst = Object.create(this); return inst.constructor(...args); }, operatorInstanceof(lhs) { return this.isPrototypeOf(lhs); } }; -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Protocol for new and instanceof?

2011-10-21 Thread Axel Rauschmayer
#set_literal_prototype_operator -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Protocol for new and instanceof?

2011-10-21 Thread Axel Rauschmayer
programming language that does this (possibly Common Lisp with its symbols, but I don’t know enough about them). It’s good to have them, because they increase JavaScript’s expressiveness. -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: Protocol for new and instanceof?

2011-10-21 Thread Axel Rauschmayer
Thanks! Nothing surprises me about Racket. Maybe when it *doesn’t* have a feature. ;-) On Oct 22, 2011, at 1:13 , Sam Tobin-Hochstadt wrote: On Fri, Oct 21, 2011 at 7:08 PM, Axel Rauschmayer a...@rauschma.de wrote: Also, in general this sort of well known private method name hook is much

Re: Protocol for new and instanceof?

2011-10-21 Thread Axel Rauschmayer
of identifying a concept and naming a concept might make sense in large systems. But it obviously makes it more difficult to edit source code (no more vi...). -- Dr. Axel Rauschmayer a...@rauschma.de home: rauschma.de twitter: twitter.com/rauschma blog: 2ality.com

Re: decoupling [ ] and property access for collections

2011-10-19 Thread Axel Rauschmayer
and dicts. Axel -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: decoupling [ ] and property access for collections

2011-10-19 Thread Axel Rauschmayer
of Object? I don’t think there is a third alternative to those two. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es

Re: decoupling [ ] and property access for collections

2011-10-19 Thread Axel Rauschmayer
#1 then you can just write a library that provides Maps and other collections. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: decoupling [ ] and property access for collections

2011-10-19 Thread Axel Rauschmayer
to, but it is conceptually very clear. Axel -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: decoupling [ ] and property access for collections

2011-10-19 Thread Axel Rauschmayer
data domain and the program definition domain. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: decoupling [ ] and property access for collections

2011-10-19 Thread Axel Rauschmayer
= function (name, value) { return Object.setProperty(name, value); } -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org

Re: decoupling [ ] and property access for collections

2011-10-19 Thread Axel Rauschmayer
: Object.prototype.operator[]get = function (name) { return Object.getProperty(this, name) ; } Object.prototype.operator[]set = function (name, value) { return Object.setProperty(this, name, value); } Correct. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de

Re: Exemplar forms

2011-10-17 Thread Axel Rauschmayer
, which aren’t too bad with class literals or one of the class definition patterns. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https

Re: Exemplar forms

2011-10-17 Thread Axel Rauschmayer
True. Yes, but an important point I was trying to make is that we already have two competing forms of exemplars (three, if you include forms using Object.create). Class literals add yet another exemplar form. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home

Re: decoupling [ ] and property access for collections

2011-10-17 Thread Axel Rauschmayer
by chaining put() method calls. -- Dr. Axel Rauschmayer a...@rauschma.de twitter.com/rauschma home: rauschma.de blog: 2ality.com ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

<    4   5   6   7   8   9   10   11   >