Function.prototype.curryCall()

2007-08-28 Thread Peter Michaux
Hi, Has JavaScript support for function currying been proposed? Maybe there is already something like this planned? Function.prototype.curryCall = function(scope) { var args = []; for (var i=1; ihttps://mail.mozilla.org/listinfo/es4-discuss

Object.prototype.clone

2007-10-21 Thread Peter Michaux
Hi, Is there a plan for a "clone" function in ES4? Object.prototype.clone = function() { function F() {} F.prototype = o; return new F(); }; The earliest reference I have found to this function is a post by Lasse Reichstein Nielsen in 2003 on comp.lang.java

Re: Object.prototype.clone

2007-10-22 Thread Peter Michaux
On 10/21/07, Kris Zyp <[EMAIL PROTECTED]> wrote: > >> http://javascript.crockford.com/prototypal.html > It is the act of creating a object that inherits from/delegates to the > provided object. Peter is suggesting sugar for one of the important > mechanisms in a prototypal language. I believe the "

Is ES3 good enough? Was incrementally strengthening ES3 paradigms considered?

2007-11-08 Thread Peter Michaux
I've been reading the blogs and fuss over the the ES4 proposal. It seems to me that if ES3 was so horribly inadequate then big changes to the language would be welcomed unanimously. It must be that ES3 is sufficient to get by well enough that we have the luxury to argue about the worth of the propo

Function.prototype.toString spec

2007-12-01 Thread Peter Michaux
ECMA-262 3rd == section 15.3.4.2 == Function.prototype.toString returns a representation with syntax of FunctionDeclaration == section13 == FunctionDeclaration: function Identifier ( FormalParameterList_opt ) { FunctionBody } FunctionExpression: function Identifier_opt ( FormalParameterL

specs of internal methods like [[Get]] in ES3 and ES4

2007-12-16 Thread Peter Michaux
On Usenet's comp.lang.javascript there has been a discussion about the internal methods like [[Get]] in the ES3 spec. I think the ES3 spec is contradictory. Section 8.6.2 starts by stressing the internal methods are "purely for expository purposes" and that an "implementation of ECMAScript must be

is the ES4 proposal as good as approved?

2007-12-19 Thread Peter Michaux
With so many ECMAScript engines rushing ahead to implement the ES4 proposal, it seems as though the proposal is as good as approved. Perhaps there will be minor tweaks but if so many implementations contain classes, for example, such a feature will almost certainly be in ES4 final. Has the voting

Re: is the ES4 proposal as good as approved?

2007-12-19 Thread Peter Michaux
On Dec 19, 2007 9:38 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > > > On Dec 19, 2007, at 9:16 PM, Peter Michaux wrote: > > With so many ECMAScript engines rushing ahead to implement the ES4 > proposal, it seems as though the proposal is as good as approved. > > No,

proper tail calls

2008-01-18 Thread Peter Michaux
Will proper tail calls be implicit in ES4 or will there be a need for special syntax? I hope it is just a required optimization but then I read this ticket http://bugs.ecmascript.org/ticket/323 and it seems there is a suggestion that the spec will only require proper tail calls with a "goto" stat

Re: proper tail calls

2008-01-19 Thread Peter Michaux
On Jan 18, 2008 10:49 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > > On Jan 18, 2008, at 9:36 PM, Peter Michaux wrote: [snip] Some of the shorthand terminology that has developed in the conversations is a bit unfamiliar to me. Hopefully my questions below are not ridiculous.

Re: proper tail calls

2008-01-21 Thread Peter Michaux
On Jan 21, 2008 5:34 AM, Igor Bukanov <[EMAIL PROTECTED]> wrote: > On 21/01/2008, Igor Bukanov <[EMAIL PROTECTED]> wrote: > > then I would prefer to make the tail calls an optional optimization in > > the same way as the type checker is optional. > > And if Haskell language specs can leave the issu

Re: proper tail calls

2008-01-21 Thread Peter Michaux
On Jan 20, 2008 8:01 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > > On Jan 20, 2008, at 5:22 PM, Erik Arvidsson wrote: > > > My concern with E (or A for that matter) is that it requires > > additional syntax. I'd prefer if we could keep the syntax small. I > > don't think implicit PTC is an issu

Re: proper tail calls

2008-01-21 Thread Peter Michaux
On Jan 21, 2008 9:59 AM, Erik Arvidsson <[EMAIL PROTECTED]> wrote: > On Mon, Jan 21, 2008 at 8:57 AM, Peter Michaux <[EMAIL PROTECTED]> wrote: > > I think Haskell and ES are in different situations as a developer > > chooses a Haskel implementation for executi

Re: proper tail calls

2008-01-21 Thread Peter Michaux
On Jan 21, 2008 10:50 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Jan 21, 2008, at 8:12 PM, Maciej Stachowiak wrote: > > How about something like "tailcall" or "tailreturn". > > Or just "tail f(x, y)", Dave Herman's suggestion. "tail" looks great and any of these three suggestions seem far b

Re: proper tail calls

2008-01-22 Thread Peter Michaux
On Jan 22, 2008 12:44 PM, Steven Johnson <[EMAIL PROTECTED]> wrote: > > On 1/22/08 12:14 PM, "Lars T Hansen" <[EMAIL PROTECTED]> wrote: > Question: should an implementation be *required* to execute a tail call as a > Proper Tail Call when possible, even if said syntax is not present? (or > merely

Re: proper tail calls

2008-01-24 Thread Peter Michaux
2008/1/24 Nathan de Vries <[EMAIL PROTECTED]>: > On Thu, 2008-01-24 at 20:04 +0100, Chris Pine wrote: > > > It was agreed that implementations would always be free to implement > > PTC... > > Really? That wasn't the impression I got. My understanding is that if > PTC isn't a requirement, it should

Why packages and namespaces?

2008-01-27 Thread Peter Michaux
What it the reason for ES4 having both packages and namespaces? It seems like both can be used to protect the global namespace from clutter and otherwise avoid identifier clashes. When to use one and when to use the other? Thank you, Peter ___ Es4-discus

Re: Why packages and namespaces?

2008-01-28 Thread Peter Michaux
Thanks for reposting Brendan's explaination. I did look around but didn't find it. On Jan 27, 2008 11:45 PM, liorean <[EMAIL PROTECTED]> wrote: > I think Brendan had a nice explanation of that some time back: > > On 10/08/2007, Brendan Eich <[EMAIL PROTECTED]> wrote: > > There's more work to do, i

Re: Why packages and namespaces?

2008-01-30 Thread Peter Michaux
On Jan 28, 2008 12:04 AM, Peter Michaux <[EMAIL PROTECTED]> wrote: > Here is a concrete problem. I tried this in the reference implementation... > > package org { > public var ecmascript = {a: 1}; > } > > package org.ecmascript { > public var a = 2; > } >

es3.1:relationship_with_the_es4_specification

2008-07-06 Thread Peter Michaux
Hi, It has been over a year since the following wiki page has been updated. http://wiki.ecmascript.org/doku.php?id=es3.1:relationship_with_the_es4_specification Has there been any resolution about how the es3.1 specification will be officially named? Given that 1) es4 intends to be capable of

proper tail calls still out of es4?

2008-07-06 Thread Peter Michaux
Hi, I'm just curious if there has been any discussion about adding proper tail calls back into es4 or if it is definitely out for good. Thanks, Peter ___ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss

Re: es3.1:relationship_with_the_es4_specification

2008-07-09 Thread Peter Michaux
On Sun, Jul 6, 2008 at 3:35 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Jul 6, 2008, at 3:06 PM, Peter Michaux wrote: > >> Has there been any resolution about how the es3.1 specification will >> be officially named? > > Yes, Ecma TC39 talked about this and the i

Re: proper tail calls still out of es4?

2008-07-09 Thread Peter Michaux
Hi Brendan, Thanks for the reply... On Sun, Jul 6, 2008 at 3:52 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > My belief is that if proper tail calls are to make a come-back, it will be > through implementors leading the way. As discussed in the linked documents > cited above, support by popular

Re: ECMAScript Harmony

2008-08-13 Thread Peter Michaux
On Wed, Aug 13, 2008 at 2:26 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: [snip] > We talked about desugaring classes in some detail in Oslo. During > these exchanges, we discussed several separable issues, including > classes, inheritance, like patterns, and type annotations. I'll avoid > writing

types

2008-08-13 Thread Peter Michaux
Reading the recent news about ES4 removing more of its old features and morphing into Harmony, it seems that the related ideas of classes, types and type checking are the surviving major new features. Personally I've never quite understood why classes, types and type-checking have been such a funda

Re: ECMAScript Harmony

2008-08-13 Thread Peter Michaux
On Wed, Aug 13, 2008 at 8:26 PM, Kris Zyp <[EMAIL PROTECTED]> wrote: >>> We talked about desugaring classes in some detail in Oslo. During >>> these exchanges, we discussed several separable issues, including >>> classes, inheritance, like patterns, and type annotations. I'll avoid >>> writing more

Re: types

2008-08-13 Thread Peter Michaux
On Wed, Aug 13, 2008 at 10:48 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Aug 13, 2008, at 8:02 PM, Peter Michaux wrote: > >> Reading the recent news about ES4 removing more of its old features >> and morphing into Harmony, it seems that the related ideas of cl

Re: types

2008-08-13 Thread Peter Michaux
On Wed, Aug 13, 2008 at 11:24 PM, Neil Mix <[EMAIL PROTECTED]> wrote: [snip] >>> Your statement above implies that types and functional programming are >>> mutually exclusive. Are they? I don't see it that way. >> >> No they aren't and I didn't mean to imply that. I intending to compare >> the

Re: types

2008-08-14 Thread Peter Michaux
On Thu, Aug 14, 2008 at 12:33 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Aug 13, 2008, at 11:37 PM, Peter Michaux wrote: [snip] >> Your points 1-4 above and the differences of opinion and preferences >> seem to be a big obstacle to overcome in a committee by consen

Re: types

2008-08-14 Thread Peter Michaux
On Thu, Aug 14, 2008 at 12:49 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Aug 13, 2008, at 11:52 PM, Peter Michaux wrote: [snip] >> I use OOP frequently in JavaScript but it isn't usually the style in >> ES3 or class-based like proposed ES4. It's the style I

Re: types

2008-08-14 Thread Peter Michaux
On Thu, Aug 14, 2008 at 12:58 PM, Neil Mix <[EMAIL PROTECTED]> wrote: > > On Aug 14, 2008, at 12:30 PM, Brendan Eich wrote: > >> I took Neil's point to favor not only a separate lint-like tool >> (which some find painful to procure and remember to run), but >> possibly something like Cormac's idea

Re: ECMAScript Harmony

2008-08-15 Thread Peter Michaux
On Fri, Aug 15, 2008 at 1:40 PM, Garrett Smith <[EMAIL PROTECTED]> wrote: [snip] >> There remain challenges, in particular getting off of the untestable >> and increasingly unwieldy ES1-3.x spec formalism. > > Unit tests: > * help developer understanding > * provide examples for discussion > *