Re: return when desugaring to closures

2008-10-09 Thread Brendan Eich
On Oct 9, 2008, at 8:57 PM, Peter Michaux wrote: > This keyword/scoping problem must already have appeared for functions > as function declarations have "var" scoping and obtaining "let" > scoping requires using something like "let a = function(){}". This is > pretty ugly for functions to have "le

Re: return when desugaring to closures

2008-10-09 Thread Peter Michaux
On Thu, Oct 9, 2008 at 4:28 PM, David Herman <[EMAIL PROTECTED]> wrote: [snip] > How would people feel about the declaration form being 'define' > instead of lambda? As in: > >define const(x) { >lambda(y) x >} > > Maybe I'm just accustomed to Scheme, but it looks awkward to me > f

Re: return when desugaring to closures

2008-10-09 Thread Brendan Eich
On Oct 9, 2008, at 6:44 PM, David Herman wrote: > Sorry, I was unclear. No, my fault for missing "declaration form". > I meant 'lambda' for the expression form and 'define' for the > definition form. Do keywords cost more than concepts? If people think define name(x) x and lambda (x) x are

Re: return when desugaring to closures

2008-10-09 Thread David Herman
Sorry, I was unclear. I meant 'lambda' for the expression form and 'define' for the definition form. Dave - Original Message - From: "Brendan Eich" <[EMAIL PROTECTED]> To: "David Herman" <[EMAIL PROTECTED]> Cc: "Peter Michaux" <[EMAIL PROTECTED]>, "es3 x-discuss" <[EMAIL PROTECTED]>, es

Re: return when desugaring to closures

2008-10-09 Thread Brendan Eich
On Oct 9, 2008, at 4:28 PM, David Herman wrote: > How would people feel about the declaration form being 'define' > instead of lambda? As in: > >define const(x) { >lambda(y) x >} > > Maybe I'm just accustomed to Scheme, but it looks awkward to me for > the declaration form to b

Re: [Caja] GC of name objects in ES3.1

2008-10-09 Thread Brendan Eich
On Oct 9, 2008, at 6:04 PM, David-Sarah Hopwood wrote: > Mike Samuel wrote: >> Mark, >> >> Do you know if the ES3.1 spec specifies GC behavior around Name >> objects that No Name objects in ES3.1. /be ___ Es-discuss mailing list Es-discuss@mozilla.o

Re: [Caja] GC of name objects in ES3.1

2008-10-09 Thread David-Sarah Hopwood
Mike Samuel wrote: > Mark, > > Do you know if the ES3.1 spec specifies GC behavior around Name objects that > are not referenced from any reachable or executing functions' scope chains, > and are not a key for any enumerable property? Typically language specs don't normatively specify GC behaviou

Re: return when desugaring to closures

2008-10-09 Thread David Herman
> I argued for "let" desugaring to "function" and I understand the > problems with "arguments", "this" and "return". In light of the > "lambda" idea below and that "let" could desugar to that more > intuitively (i.e. Tenent's principle) to "lambda", I think what I was > really asking/arguing for wa

Re: return when desugaring to closures

2008-10-09 Thread David Herman
> My question was whether the semantics of break and continue would > support the following: Yes, this is another good case to consider. Thanks for pointing it out; I'll add this to the strawman:lambdas proposal. Essentially this is another aspect of the semantics of 'function' that is implicit

Re: return when desugaring to closures

2008-10-09 Thread Brendan Eich
On Oct 9, 2008, at 3:31 PM, Peter Michaux wrote: >> So, to avoid trouble, we've been thinking of new forms including a >> better >> function, call it lambda, > > Please call it "lambda"! :) We do. Hard to beat, IMHO -- even if it originated in a typographical compromise (http://dn.codegear.co

Re: return when desugaring to closures

2008-10-09 Thread Peter Michaux
On Thu, Oct 9, 2008 at 2:31 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: [snip] > Sorry for the very tardy reply. You make good points in the abstract, and > the messy language-specific details of existing semantics for functions not > being clean enough deserves a better response than just "don't

Re: return when desugaring to closures

2008-10-09 Thread Brendan Eich
On Oct 9, 2008, at 3:05 PM, Lex Spoon wrote: > On Thu, Oct 9, 2008 at 5:31 PM, Brendan Eich <[EMAIL PROTECTED]> > wrote: JS has break from labeled statement, and continue to labeled > loop bottom, a la Java. These look trouble-free to me. Let me know > if you see a hard case. Thanks, > > My

Re: return when desugaring to closures

2008-10-09 Thread Lex Spoon
On Thu, Oct 9, 2008 at 5:31 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > > JS has break from labeled statement, and continue to labeled loop bottom, a > la Java. These look trouble-free to me. Let me know if you see a hard case. > Thanks, > My question was whether the semantics of break and conti

Re: return when desugaring to closures

2008-10-09 Thread Brendan Eich
On Sep 2, 2008, at 2:16 PM, Lex Spoon wrote: > On Sun, Aug 24, 2008 at 3:17 AM, Brendan Eich <[EMAIL PROTECTED]> > wrote: >> First, let's settle the hash over whether any desugaring without >> extensions such as return-to-label, reformed lexical scope, tamed >> this, banished arguments, etc. etc

Garbage collection of Name objects

2008-10-09 Thread Mike Samuel
I was looking at http://wiki.ecmascript.org/doku.php?id=strawman:names on Name objects, and was wondering whether garbage collection of name objects has been discussed. I'm not a GC expert, so the below may be hopelessly naive, and I don't know whether this kind of thing is appropriate for a langu