Re: Do Maximally Minimal classes carry their weight?

2012-04-03 Thread Allen Wirfs-Brock
On Apr 2, 2012, at 5:00 PM, John J Barton wrote: Allen's original post on this thread offered two choices: 1) extended object literals, (good building blocks). 2) both, (because class gives 80% and thus they complement). Erik and Tab are arguing for 3) Min-max classes (we need 80%,

Re: Protected Protocol

2012-04-03 Thread David Bruant
Le 02/04/2012 17:59, Irakli Gozalishvili a écrit : Hi David, Your protected work reminds me a lot of what we did with `namespcase` module in jetpack: https://addons.mozilla.org/en-US/developers/docs/sdk/latest/packages/api-utils/namespace.html Which I also blogged about some time ago:

Re: arrow function syntax simplified

2012-04-03 Thread Claus Reinke
I agree that leading |this| could be important for dynamic non-method use-cases, but those are relatively rare (let's not discount JQuery, but again, it could use long functions and survive). We could put leading-this-parameterization on the agenda for May, but we'll have to be careful not

Re: Development Mode/Production Mode

2012-04-03 Thread David Bruant
Le 01/04/2012 13:38, Wes Garland a écrit : In a similar vein, I would personally like to have zero-cost-when-not-debugging assert() statements, and am hopeful that statically-linked modules might lead the way. It seems to me that what you're asking for is macros, isn't it? I read hints here

Re: Modules: compile time linking (was Re: Modules feedback, proposal)

2012-04-03 Thread Claus Reinke
Libraries will need to work in old world browsers for a few years. Possible solutions: a) Ask libraries to provide a lib.es-next.js version of themselves in addition to the old world version, so that compile time linking with new module/import syntax can be used. b) Have a way for the library

Re: Protected Protocol

2012-04-03 Thread Kris Kowal
On Tue, Apr 3, 2012 at 1:49 AM, David Bruant bruan...@gmail.com wrote: Le 02/04/2012 17:59, Irakli Gozalishvili a écrit : I remember that one of your complaints about namespaces was that inheritance was not supported. Do you think there is a workable middleground between namespaces and what

Re: Development Mode/Production Mode

2012-04-03 Thread John J Barton
On Tue, Apr 3, 2012 at 7:03 AM, David Bruant bruan...@gmail.com wrote: Le 01/04/2012 13:38, Wes Garland a écrit : In a similar vein, I would personally like to have zero-cost-when-not-debugging assert() statements, and am hopeful that statically-linked modules might lead the way. It seems

Re: Development Mode/Production Mode

2012-04-03 Thread David Bruant
Le 03/04/2012 17:12, John J Barton a écrit : On Tue, Apr 3, 2012 at 7:03 AM, David Bruant bruan...@gmail.com mailto:bruan...@gmail.com wrote: Le 01/04/2012 13:38, Wes Garland a écrit : In a similar vein, I would personally like to have zero-cost-when-not-debugging assert()

Re: Protected Protocol

2012-04-03 Thread David Bruant
Le 03/04/2012 17:00, Kris Kowal a écrit : On Tue, Apr 3, 2012 at 1:49 AM, David Bruantbruan...@gmail.com wrote: Le 02/04/2012 17:59, Irakli Gozalishvili a écrit : I remember that one of your complaints about namespaces was that inheritance was not supported. Do you think there is a workable

Re: Protected Protocol

2012-04-03 Thread Irakli Gozalishvili
On Tuesday, 2012-04-03 at 01:49 , David Bruant wrote: Le 02/04/2012 17:59, Irakli Gozalishvili a écrit : Hi David, Your protected work reminds me a lot of what we did with `namespcase` module in jetpack:

Re: Protected Protocol

2012-04-03 Thread Irakli Gozalishvili
Ah looks like Kris already pointed that out Regards -- Irakli Gozalishvili Web: http://www.jeditoolkit.com/ On Tuesday, 2012-04-03 at 08:00 , Kris Kowal wrote: On Tue, Apr 3, 2012 at 1:49 AM, David Bruant bruan...@gmail.com (mailto:bruan...@gmail.com) wrote: Le 02/04/2012 17:59, Irakli

Re: arrow function syntax simplified

2012-04-03 Thread Allen Wirfs-Brock
On Apr 3, 2012, at 2:01 AM, Claus Reinke wrote: I agree that leading |this| could be important for dynamic non-method use-cases, but those are relatively rare (let's not discount JQuery, but again, it could use long functions and survive). We could put leading-this-parameterization on

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Peter van der Zee
Second... On Tue, Apr 3, 2012 at 10:16 PM, Mark S. Miller erig...@google.com wrote:     foo(a, b, ...rest) vs     foo(a, b, rest...) Which is clearer? ES6 has currently agreed on the first. English and Scheme agree on the second. This question applies to both

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Axel Rauschmayer
Call me crazy, but I’d use postfix for a declaration of a rest parameter and prefix for spreading. To me, prefix feels like it does something, while postfix has more of a declarative feel. function foo(a, rest...) { bar(...rest); } Whatever we choose, people will get used to it. So I don’t

Re: callable objects ?

2012-04-03 Thread Russell Leggett
I agree that this is really elegant. I have almost the exact same construct in a language I'm designing. I don't know if it has a place in JS, but you have my approval. :) - Russ On Tue, Apr 3, 2012 at 4:00 PM, Irakli Gozalishvili rfo...@gmail.comwrote: Hi, Please excuse me if this will

Re: callable objects ?

2012-04-03 Thread David Bruant
Le 03/04/2012 22:00, Irakli Gozalishvili a écrit : Here is more or less what I have in mind: https://gist.github.com/2295048 // class var Point = { (x, y) { this.getX = { () { return x; } } this.getY = { () { return x; } } } toString() { return '' + this.getX() + ',' +

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Russell Leggett
Second... In fact, I think I've even written a few code examples accidentally using that form because it was just more natural. On Tue, Apr 3, 2012 at 4:16 PM, Mark S. Miller erig...@google.com wrote: foo(a, b, ...rest) vs foo(a, b, rest...) Which is clearer? ES6 has currently

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Erik Arvidsson
FWIW, Python and Ruby uses prefix (the * operator). Java and C++11 uses prefix ... (actually suffix on the type). My vote is for prefix. On Tue, Apr 3, 2012 at 14:08, Russell Leggett russell.legg...@gmail.com wrote: Second... In fact, I think I've even written a few code examples

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Jorge
On Apr 3, 2012, at 10:16 PM, Mark S. Miller wrote: foo(a, b, ...rest) vs foo(a, b, rest...) Which is clearer? ES6 has currently agreed on the first. English and Scheme agree on the second. The second, of course. As in C: the ellipsis always ends the parameters list. --

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Allen Wirfs-Brock
I find the prefix more readable, in both situations. I read from left to right, and it is clearer when the most semantically important symbol comes as early as possible in that left to right progression. Allen On Apr 3, 2012, at 2:32 PM, Erik Arvidsson wrote: FWIW, Python and Ruby uses

Re: callable objects ?

2012-04-03 Thread Irakli Gozalishvili
On Tuesday, 2012-04-03 at 14:07 , David Bruant wrote: Le 03/04/2012 22:00, Irakli Gozalishvili a écrit : Here is more or less what I have in mind: https://gist.github.com/2295048 // class var Point = { (x, y) { this.getX = { () { return x; } } this.getY = { () {

Re: callable objects ?

2012-04-03 Thread Irakli Gozalishvili
On Tuesday, 2012-04-03 at 13:47 , Axel Rauschmayer wrote: I think you should make the distinction between [[Call]] and [[Construct]]. You can do it via (this insntanceof ..) already and dispatch to call / construct if you want. But both would be great to have for objects. It’s

Re: callable objects ?

2012-04-03 Thread Irakli Gozalishvili
Also I just realized that I have not mentioned it but I meant that new Point(0, 0) would do following: var point = Object.create(Point); var value = Function.apply.call(point, arguments); return typeof(value) === 'undefined' ? point : value; Regards -- Irakli Gozalishvili Web:

Re: Should ... be suffix rather than prefix?

2012-04-03 Thread Irakli Gozalishvili
Second feels more intuitive to me Regards -- Irakli Gozalishvili Web: http://www.jeditoolkit.com/ On Tuesday, 2012-04-03 at 13:16 , Mark S. Miller wrote: foo(a, b, ...rest) vs foo(a, b, rest...) Which is clearer? ES6 has currently agreed on the first. English and Scheme