Re: Es-discuss - several decimal discussions

2008-08-25 Thread Brendan Eich
On Aug 24, 2008, at 10:02 PM, Mark S. Miller wrote: Let's say you did that -- make a special case for NaN but not for -0. Let's say you use this Map to build memoize. Now let's say someone writes a purely functional function F such that F(0) is 3 and F(-0) is 7. Let's say G is memoize(F).

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Brendan Eich
On Aug 24, 2008, at 8:40 PM, Peter Michaux wrote: Polls are not so good, compared to reasons. Could you give your rationale and talk about the trade-offs, in your experience? You summed it up nicely with the hat trick: It's a nice hat trick: privacy, higher integrity, and semantic reuse

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Brendan Eich
On Aug 24, 2008, at 9:44 PM, Kris Zyp wrote: I am surprised this is up for debate, I would also think that we would want instance-private by default. We can debate lots of things, some that might actually be in play. AFAIK this one is not decided in the committee (it's way too early),

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Peter Michaux
On Sun, Aug 24, 2008 at 9:44 PM, Kris Zyp [EMAIL PROTECTED] wrote: Desugared from: class Point { private var x = Math.random(); function getX(){ return this.x; } ... } Is there any need for the this.? Some languages allow this.x to get out from under the shadow of a local

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Sam Ruby
On Mon, Aug 25, 2008 at 12:47 AM, Mark S. Miller [EMAIL PROTECTED] wrote: On Sun, Aug 24, 2008 at 8:09 PM, Sam Ruby [EMAIL PROTECTED] wrote: As to what the what the value of 1.0m == 1.00m should be, the amount of code and the amount of spec writing effort is the same either way. I can see

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Sam Ruby
On Mon, Aug 25, 2008 at 1:44 AM, Brendan Eich [EMAIL PROTECTED] wrote: On Aug 24, 2008, at 8:09 PM, Sam Ruby wrote: If there were an Object.eq method, then 1.1m and 1.10m should be considered different by such a function. I don't believe that decimal, by itself, justifies the addition of an

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Mark S. Miller
On Sun, Aug 24, 2008 at 11:20 PM, Brendan Eich [EMAIL PROTECTED] wrote: Yes, this is gross. I'm in favor of Object.identical and Object.hashcode, I don't care if Object.eq is named Object.identical. Other than spelling, does your Object.identical differ from Object.eq? If not, then I think we're

Re: eq, eql, equal [Was: Es-discuss - several decimal discussions]

2008-08-25 Thread Mark S. Miller
On Mon, Aug 25, 2008 at 6:50 AM, P T Withington [EMAIL PROTECTED] wrote: FWIW, as a user, I've always assumed: == : equal [1] [1, 2] == [1, 2] // yields false -- Cheers, --MarkM ___ Es-discuss mailing list Es-discuss@mozilla.org

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Sam Ruby
On Mon, Aug 25, 2008 at 9:45 AM, Mark S. Miller [EMAIL PROTECTED] wrote: On Sun, Aug 24, 2008 at 11:20 PM, Brendan Eich [EMAIL PROTECTED] wrote: Yes, this is gross. I'm in favor of Object.identical and Object.hashcode, I don't care if Object.eq is named Object.identical. Other than spelling,

Re: Es-discuss - several decimal discussions

2008-08-25 Thread David Jones
On 25 Aug 2008, at 12:29, Sam Ruby wrote: the next-edition-of-ES-that-provides-decimal (my working assumption still is 3.1 whatever that may be called, others may be understandably skeptical) Clearly that version should be called 3.1m! drj ___

Re: Thoughts on IEEE P754

2008-08-25 Thread Steven Johnson
FWIW, ByteArray has been immensely popular (and useful) in ActionScript 3. I would hope it can make it into both 3.1 and Harmony. (ByteVector is probably a better name, though, as its behavior is more Vector-like than Array-like.) On 8/23/08 6:49 PM, Brendan Eich [EMAIL PROTECTED] wrote:

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 12:34 AM, Peter Michaux wrote: On Sun, Aug 24, 2008 at 9:44 PM, Kris Zyp [EMAIL PROTECTED] wrote: Desugared from: class Point { private var x = Math.random(); function getX(){ return this.x; } ... } Is there any need for the this.? Some languages

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 6:39 AM, Kris Zyp wrote: I am surprised this is up for debate, I would also think that we would want instance-private by default. We can debate lots of things, some that might actually be in play. AFAIK this one is not decided in the committee (it's way too

Re: return when desugaring to closures

2008-08-25 Thread Mark S. Miller
On Sun, Aug 24, 2008 at 12:31 AM, Brendan Eich [EMAIL PROTECTED] wrote: On Aug 23, 2008, at 10:23 PM, Mark S. Miller wrote: On Sat, Aug 23, 2008 at 8:36 PM, Peter Michaux [EMAIL PROTECTED] wrote: (function (x, y) {...})(a, b) would be quite welcome. It is clear people like this pattern and

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 4:29 AM, Sam Ruby wrote: If Decimal is an object type, then typeof 1.0m == object is good for a couple of reasons: * Future-proof in case we do add a primitive decimal type, as ES4 proposed -- a peer of double that shares Number.prototype; typeof on a decimal would

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 6:45 AM, Mark S. Miller wrote: maybe even in ES3.1 (I should get my act together and help spec 'em). (I will help on identical/hashcode, btw -- think we're agreeing vehemently ;-).) Just not particularly on account of Decimal, even with equated cohort members. I

Re: eq, eql, equal [Was: Es-discuss - several decimal discussions]

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 6:58 AM, Mark S. Miller wrote: On Mon, Aug 25, 2008 at 6:50 AM, P T Withington [EMAIL PROTECTED] wrote: FWIW, as a user, I've always assumed: == : equal [1] [1, 2] == [1, 2] // yields false This makes me sad, but some day there might be ways to attach multimethods

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Mark S. Miller
On Mon, Aug 25, 2008 at 1:20 PM, Brendan Eich [EMAIL PROTECTED] wrote: (I will help on identical/hashcode, btw -- think we're agreeing vehemently ;-).) ;) !! On Mon, Aug 25, 2008 at 1:20 PM, Brendan Eich [EMAIL PROTECTED] wrote: On Aug 25, 2008, at 6:45 AM, Mark S. Miller wrote: What is it

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 12:23 PM, Peter Michaux wrote: To refer to the instance in the sugared language, and there are valid use-cases for doing so, we should use |this|. There's no point in introducing a new keyword. If there is a need to refer to the instance then this does make sense. What

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Sam Ruby
On Mon, Aug 25, 2008 at 9:45 AM, Mark S. Miller [EMAIL PROTECTED] wrote: On Sun, Aug 24, 2008 at 11:20 PM, Brendan Eich [EMAIL PROTECTED] wrote: Yes, this is gross. I'm in favor of Object.identical and Object.hashcode, I don't care if Object.eq is named Object.identical. Other than spelling,

Re: Es-discuss - several decimal discussions

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 1:59 PM, Mark S. Miller wrote: On Mon, Aug 25, 2008 at 1:20 PM, Brendan Eich [EMAIL PROTECTED] wrote: On Aug 25, 2008, at 6:45 AM, Mark S. Miller wrote: What is it you and Sam are agreeing about? I lost track. That if we make cohort members == and ===, telling anyone

Re: return when desugaring to closures

2008-08-25 Thread Mark S. Miller
I wrote: Since generators are shallow, it seems clear that there should be some local cps-style transform of generators into the remainder of the language. However, it would be a relief to know what that cps-style transform actually looks like, and what edge cases it has. Anyone care to post

Re: local

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 3:00 PM, Ingvar von Schoultz wrote: ...we'll have to write something like this? const { DatabaseName, DisplayCount, ... Ten more ... } = Debugging ? { DatabaseName: TestDatabase, DisplayCount: 5, ...

How many NaNs do we now have?

2008-08-25 Thread Waldemar Horwat
What should compareTotal do when you compare -NaN and NaN? Waldemar ___ Es-discuss mailing list Es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: return when desugaring to closures

2008-08-25 Thread Mark S. Miller
On Fri, Aug 22, 2008 at 7:27 AM, Neil Mix [EMAIL PROTECTED] wrote: Since generators are shallow, it seems clear that there should be some local cps-style transform of generators into the remainder of the language. However, it would be a relief to know what that cps-style transform actually

Re: return when desugaring to closures

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 4:10 PM, Mark S. Miller wrote: are shallow generators implementable by a local cps transform? Yes, the local evaluation (inside the generator function) is the only place that needs to be CPS'ed to allow yield in any expression or statement context. This approach

Consistent decimal semantics

2008-08-25 Thread Waldemar Horwat
We're going round in circles on a few issues surrounding Decimal. Some of these have clear resolutions; others have a little wiggle room. Here's my summary: - Should decimal values behave as objects (pure library implementation) or as primitives? If they behave as objects, then we'd get

Re: Consistent decimal semantics

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 4:41 PM, Waldemar Horwat wrote: We're going round in circles on a few issues surrounding Decimal. It seems to me people have reached the conclusion you already did on ===. I'm not sure anyone advocated otherwise (I've missed most 3.1 calls lately, so can't be sure).

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Peter Michaux
On Mon, Aug 25, 2008 at 2:01 PM, Brendan Eich [EMAIL PROTECTED] wrote: On Aug 25, 2008, at 12:23 PM, Peter Michaux wrote: Now there is another problem: differentiating between which variables are local to the constructor function (that is, transient and garbage collected after the

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 4:57 PM, Peter Michaux wrote: There needs to be a way(s) to distinguish which variables have which lifetimes and visibilities. We have ways already: explicit blocks containing let-declared temporaries; your public to make things visible outside their lexical scope.

Re: Consistent decimal semantics

2008-08-25 Thread Waldemar Horwat
Brendan Eich wrote: - Should decimal values behave as objects (pure library implementation) or as primitives? If they behave as objects, then we'd get into situations such as 3m != 3m in some cases and 3m == 3m in other cases. Also, -0m != 0m would be necessary. This is clearly

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread ihab . awad
On Mon, Aug 25, 2008 at 5:23 PM, Brendan Eich [EMAIL PROTECTED] wrote: On Aug 25, 2008, at 4:57 PM, Peter Michaux wrote: I think the ability to have two modules in one file means modules will need to name themselves. That is they will need to be declared with a name like module foo { //

Re: Consistent decimal semantics

2008-08-25 Thread Sam Ruby
Waldemar Horwat wrote: We're going round in circles on a few issues surrounding Decimal. Some of these have clear resolutions; others have a little wiggle room. Here's my summary: I don't believe that we are going around in circles. I've got a tangible implementation that is tracking to the

Re: return when desugaring to closures

2008-08-25 Thread Mark S. Miller
On Mon, Aug 25, 2008 at 4:33 PM, Brendan Eich [EMAIL PROTECTED] wrote: On Aug 25, 2008, at 4:10 PM, Mark S. Miller wrote: are shallow generators implementable by a local cps transform? Yes, the local evaluation (inside the generator function) is the only place that needs to be CPS'ed to

Re: return when desugaring to closures

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 6:15 PM, Mark S. Miller wrote: Thanks, that helps a lot. But shouldn't that i == n be !(i n) since it's a transform of the original i n? Sure -- was going fast (other work competing ;-). On Thu, Aug 21, 2008 at 11:31 PM, Dave Herman [EMAIL PROTECTED] wrote: Can't

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Erik Arvidsson
2008/8/25 Kris Zyp [EMAIL PROTECTED]: A lot of Ajax widgets, e.g. Dojo, use their own inheritance models, often based on copying properties (sometimes based on prototypes; in the case of Dojo's MI, both!). Copying is fine for a zero-inheritance classes-as-sugar proposal. The prototype stuff, as

Re: Look Ma, no this (was: ECMAScript Harmony)

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 7:07 PM, Erik Arvidsson wrote: I've been quiet on these threads for a long time but i just wanted to emphasize Kris's point. Whatever we decide to desugar the class syntax into I think it is very important to get this right. We need to make classes work with existing

Re: return when desugaring to closures

2008-08-25 Thread Dave Herman
Brendan Eich wrote: Dave, is the violent transform of the for-loop above the kind of rest-of-the-language transform you were referring to? Answering for Dave: yes. Sorry for the delay-- yes, any kind of construct in the language other than function/method/constructor call would require CPS.

Re: return when desugaring to closures

2008-08-25 Thread Mark S. Miller
On Mon, Aug 25, 2008 at 7:24 PM, Dave Herman [EMAIL PROTECTED] wrote: But I'd still rather not try to understand generators by CPS-transforming the relevant bits of the RI. A little confused here-- was that an errant not? No. I meant that, since I understand continuation by CPS-transform, if

Re: return when desugaring to closures

2008-08-25 Thread Brendan Eich
On Aug 25, 2008, at 8:51 PM, Mark S. Miller wrote: How important is it that yield be an expression rather than a statement? It seems like a sibling of return and throw, so I don't think anyone coming to them afresh would be surprised if yield were a statement. This is and was not a