Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 9:33 PM, Allen Wirfs-Brock <[EMAIL PROTECTED]> wrote: > The BGGA Java closure proposal attempts to support control abstractions that > look like built in control constructs by allowing trailing literal closure > arguments to appear after the parenthesized argument list (sh

RE: Allen's lambda syntax proposal

2008-12-01 Thread Allen Wirfs-Brock
Below >-Original Message- >From: Maciej Stachowiak [mailto:[EMAIL PROTECTED] >Can you give an example? Since ECMAScript's built-in control >structures already have special syntax, it's hard to make anything >look *exactly* like them. > >Here's my best shot at an example. Let's pretend you

Re: Allen's lambda syntax proposal

2008-12-01 Thread David-Sarah Hopwood
Breton Slivka wrote: >> Is recursion still desirable in this form. If so, then of the three I like >> >>\(a,b,c) {} >> >> because you can think of the \ as being an abbreviation of function. >> >>\ name(a,b,c) {} >> >> Just don't start your function name with u. Too ambiguous, even with th

Re: RE: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 5:37 PM, Allen Wirfs-Brock <[EMAIL PROTECTED]> wrote: >>-Original Message- >>From: [EMAIL PROTECTED] [mailto:es-discuss- >>[EMAIL PROTECTED] On Behalf Of Douglas Crockford > ... >>because you can think of the \ as being an abbreviation of function. >> >> \ name(a,

Re: Allen's lambda syntax proposal

2008-12-01 Thread Maciej Stachowiak
On Dec 1, 2008, at 5:37 PM, Allen Wirfs-Brock wrote: -Original Message- From: [EMAIL PROTECTED] [mailto:es-discuss- [EMAIL PROTECTED] On Behalf Of Douglas Crockford ... because you can think of the \ as being an abbreviation of function. \ name(a,b,c) {} Just don't start your fun

Re: Allen's lambda syntax proposal

2008-12-01 Thread Maciej Stachowiak
On Dec 1, 2008, at 2:32 PM, Allen Wirfs-Brock wrote: {|a,b,c| ...} or \(a,b,c) {...} or {\(a,b,c) ...} I could be happy with any of them and can find pros and cons with each. I think the high order bit should be that a concise closure syntax is possible and desirable. If we agree on that

RE: RE: Allen's lambda syntax proposal

2008-12-01 Thread Allen Wirfs-Brock
>-Original Message- >From: [EMAIL PROTECTED] [mailto:es-discuss- >[EMAIL PROTECTED] On Behalf Of Douglas Crockford ... >because you can think of the \ as being an abbreviation of function. > > \ name(a,b,c) {} > >Just don't start your function name with u. > Exactly, that's why I didn'

Re: Allen's lambda syntax proposal

2008-12-01 Thread Felix
oh, right, forgot e4x. ok, one objection to \(){} is that it looks too much like a function. in particular, it "feels like" I should write var a = \(x){ return x; }; but that isn't right, {||} is sufficiently different that it "feels like" I should write var a = {|x| x}; Brendan Eich wrote:

Re: RE: Allen's lambda syntax proposal

2008-12-01 Thread Breton Slivka
> Is recursion still desirable in this form. If so, then of the three I like > >\(a,b,c) {} > > because you can think of the \ as being an abbreviation of function. > >\ name(a,b,c) {} > > Just don't start your function name with u. > well if we're thinking about lambdas as blocks++, then

Re: Allen's lambda syntax proposal

2008-12-01 Thread Brendan Eich
On Dec 1, 2008, at 3:47 PM, Felix wrote: @ is unused @(a, b, c){} @ is already used by ECMA-357 (E4X). Also some tradition of denoting dereference (Cyclone, managed C++ IIRC). Hard to beat \ if we want the parenthesized formal parameter list in front. /be Douglas Crockford wrote:

Re: Allen's lambda syntax proposal

2008-12-01 Thread Felix
@ is unused @(a, b, c){} Douglas Crockford wrote: Allen Wirfs-Brock wrote: {|a,b,c| ...} or \(a,b,c) {...} or {\(a,b,c) ...} The use of \ slightly bothers me because it is takes a character > that now is exclusively used in the lexical (token) grammar >( Unicode escapes, string escapes

Re: RE: Allen's lambda syntax proposal

2008-12-01 Thread Douglas Crockford
Allen Wirfs-Brock wrote: {|a,b,c| ...} or \(a,b,c) {...} or {\(a,b,c) ...} The use of \ slightly bothers me because it is takes a character > that now is exclusively used in the lexical (token) grammar >( Unicode escapes, string escapes, line continuations) > and gives it syntactic significan

Re: Trac issue reports

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 2:18 PM, Brendan Eich <[EMAIL PROTECTED]> wrote: > You two have trac accounts at http://bugs.ecmascript.org/ - Thanks. Hopefully non-committee members can be of some assistance. Peter ___ Es-discuss mailing list Es-discuss@mozilla

RE: Allen's lambda syntax proposal

2008-12-01 Thread Allen Wirfs-Brock
{|a,b,c| ...} or \(a,b,c) {...} or {\(a,b,c) ...} I could be happy with any of them and can find pros and cons with each. I think the high order bit should be that a concise closure syntax is possible and desirable. If we agree on that then we just need to pick one. The use of \ slightly bothe

Re: Trac issue reports

2008-12-01 Thread Brendan Eich
You two have trac accounts at http://bugs.ecmascript.org/ -- and it turns out a bunch of others (yrchen, wycats, voracity, et al.) were added over the last 13+ months. Anyone who wants to file a ticket on an ES3.1 spec bug (after searching for dups, of course ;-), please mail me. /be On

Re: Allen's lambda syntax proposal

2008-12-01 Thread P T Withington
On 2008-12-01, at 15:59EST, Maciej Stachowiak wrote: \(a, b, c) { ... } +1 ___ Es-discuss mailing list Es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Allen's lambda syntax proposal

2008-12-01 Thread Breton Slivka
Question: How would I write a recursive function with that syntax? Is there a way to name the lambda, other than var = {||}; ? ___ Es-discuss mailing list Es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Allen's lambda syntax proposal

2008-12-01 Thread Maciej Stachowiak
On Nov 29, 2008, at 10:30 PM, Brendan Eich wrote: At the TC39 meeting two weeks ago in Kona, we had a brief bikeshedding discussion about lambda syntax and why it matters. Observation: blocks in Smalltalk being lightweight means users don't mind writing them for control abstractions, compa

Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 12:19 PM, Allen Wirfs-Brock <[EMAIL PROTECTED]> wrote: > JavaScript already has a concise "ASCII vomit" syntax for constructing arrays > and objects. I didn't mean to imply that JavaScript currently deserves the "ASCII vomit" label. I also didn't mean to imply the {||} was

RE: Allen's lambda syntax proposal

2008-12-01 Thread Allen Wirfs-Brock
Just to clarify some speculation, the syntax I proposed ({||}) was solely inspired by Smalltalk and tempered by the parsing realities of a C-like syntax. Any similarities to Ruby constructs are probably examples of parallel evolution under similar environmental pressures. I suspect that designe

Re: How much sugar do classes need?

2008-12-01 Thread David-Sarah Hopwood
Peter Michaux wrote: > On Sat, Nov 29, 2008 at 9:49 PM, Mark S. Miller <[EMAIL PROTECTED]> wrote: > >>> var self = { >>>to toString() { >>> return '<' + self.getX() + ',' + self.getY() + '>'; >>>}, >>>to getX() { return x; }, >>>to getY() { return y; } >>>let pubInstVar:

Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 10:24 AM, Brendan Eich <[EMAIL PROTECTED]> wrote: > On Dec 1, 2008, at 10:17 AM, Peter Michaux wrote: >> Take an ES program and replace all if-else with ?: and then most >> functions with {||} and it starts to look quite cryptic. > > But functions remain. I doubt lambdas in

Re: Allen's lambda syntax proposal

2008-12-01 Thread Brendan Eich
On Dec 1, 2008, at 10:17 AM, Peter Michaux wrote: On Mon, Dec 1, 2008 at 7:31 AM, P T Withington <[EMAIL PROTECTED]> wrote: On 2008-11-30, at 01:30EST, Brendan Eich wrote: // Instead of lambda (a, b, c) { ... }, why not: { |a, b, c| ... } ? I would rather have a more literate syntax, lest w

Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 7:31 AM, P T Withington <[EMAIL PROTECTED]> wrote: > On 2008-11-30, at 01:30EST, Brendan Eich wrote: > >> // Instead of lambda (a, b, c) { ... }, why not: >> { |a, b, c| ... } ? > > I would rather have a more literate syntax, lest we degenerate to where > practically any comi

Re: Understanding reasons for Harmony

2008-12-01 Thread Aaron Gray
Brendan, Great shame, but as you say its a broken design. Many thanks for the full explanation, Aaron - Original Message - From: Brendan Eich To: Aaron Gray Cc: es-discuss@mozilla.org Sent: Monday, December 01, 2008 1:06 AM Subject: Re: Understanding reasons for Harmony

Re: Newbie Q's

2008-12-01 Thread Aaron Gray
Aaron Gray wrote: Hi, I have been beginning to read the ML reference implementation and have a few basic questions. What is REPL and what does it stand for ? What is a RIB and does it stand for anything ? What are FIXTURES ? REPL stands for "read, eval, print loop". It's lisp slang for "i

Re: Allen's lambda syntax proposal

2008-12-01 Thread P T Withington
On 2008-12-01, at 11:54EST, Mark S. Miller wrote: On Mon, Dec 1, 2008 at 8:47 AM, P T Withington <[EMAIL PROTECTED]> wrote: Eh? So: function () { var foo = 42; {|| var foo = 3; } return foo; } and: function () { var foo = 42; { var foo = 3; } return foo; } Give the same answer? No, be

Re: Newbie Q's

2008-12-01 Thread Graydon Hoare
Aaron Gray wrote: Hi, I have been beginning to read the ML reference implementation and have a few basic questions. What is REPL and what does it stand for ? What is a RIB and does it stand for anything ? What are FIXTURES ? REPL stands for "read, eval, print loop". It's lisp slang for

Re: Allen's lambda syntax proposal

2008-12-01 Thread Mark S. Miller
On Mon, Dec 1, 2008 at 8:47 AM, P T Withington <[EMAIL PROTECTED]> wrote: > > Eh? So: > > function () { > var foo = 42; > {|| var foo = 3; } > return foo; > } > > and: > > function () { > var foo = 42; > { var foo = 3; } > return foo; > } > > Give the same answer? No, because you forgot t

Re: Allen's lambda syntax proposal

2008-12-01 Thread P T Withington
On 2008-12-01, at 11:30EST, Mark S. Miller wrote: On Mon, Dec 1, 2008 at 7:31 AM, P T Withington <[EMAIL PROTECTED]> wrote: On 2008-11-30, at 01:30EST, Brendan Eich wrote: // Instead of lambda (a, b, c) { ... }, why not: { |a, b, c| ... } ? I would rather have a more literate syntax, lest

Re: Allen's lambda syntax proposal

2008-12-01 Thread Mark S. Miller
On Mon, Dec 1, 2008 at 7:31 AM, P T Withington <[EMAIL PROTECTED]> wrote: > On 2008-11-30, at 01:30EST, Brendan Eich wrote: > > // Instead of lambda (a, b, c) { ... }, why not: >> { |a, b, c| ... } ? >> > > I would rather have a more literate syntax, lest we degenerate to where > practically any

Re: Allen's lambda syntax proposal

2008-12-01 Thread P T Withington
On 2008-11-30, at 01:30EST, Brendan Eich wrote: // Instead of lambda (a, b, c) { ... }, why not: { |a, b, c| ... } ? I would rather have a more literate syntax, lest we degenerate to where practically any comic book blasphemy is a valid program. (BTW, I'm pretty sure I have that same Byte

Re: Allen's lambda syntax proposal

2008-12-01 Thread Chris Pine
Peter Michaux wrote: On Mon, Dec 1, 2008 at 2:06 AM, Chris Pine <[EMAIL PROTECTED]> wrote: Brendan Eich wrote: // Instead of lambda (a, b, c) { ... }, why not: { |a, b, c| ... } ? Looks like Ruby to me, so you know I love it. :) Nice lambda syntax really matters. If that tool is too heavy,

Re: Allen's lambda syntax proposal

2008-12-01 Thread Peter Michaux
On Mon, Dec 1, 2008 at 2:06 AM, Chris Pine <[EMAIL PROTECTED]> wrote: > Brendan Eich wrote: >> >> // Instead of lambda (a, b, c) { ... }, why not: >> { |a, b, c| ... } ? > > Looks like Ruby to me, so you know I love it. :) > > Nice lambda syntax really matters. If that tool is too heavy, I only u

ES3.1 Draft: 01 Dec 2008 version available

2008-12-01 Thread Pratap Lakshman (VJ#SDK)
I have uploaded to the wiki (link) the 01 Dec 2008 draft of the specification for ES3.1. This is in the form of in-place edits and markups to the ES3 specification. Revision history is at the end of the document. The ma

Re: Allen's lambda syntax proposal

2008-12-01 Thread Chris Pine
Brendan Eich wrote: // Instead of lambda (a, b, c) { ... }, why not: { |a, b, c| ... } ? Looks like Ruby to me, so you know I love it. :) Nice lambda syntax really matters. If that tool is too heavy, I only use it half as often as I should. Chris __