Re: Block lambda is cool, its syntax isn't

2012-01-13 Thread Quildreen Motta
I have an obvious bias towards 1 because I think Unicode symbols describe much better the underlying intentions and semantics than their ASCII alternatives (usually), however not many people creates mappings for these symbols on their .XCompose (or even have a compose key handy). I remember you

Re: Block lambda exiting function during execurtion

2012-01-13 Thread David Herman
On Jan 13, 2012, at 4:27 AM, François REMY wrote: To be useful, I think the behavior should be (1) yes (2) yes (3) doesn’t happen; see 2. (4) doesn’t happen; see 2. That's correct. The return is bound to getAnyWhere and breaks out of the forEach loop. However, it seems rather complex

Re: Octal literals have their uses (you Unix haters skip this one)

2012-01-13 Thread Brendan Eich
Lasse Reichstein January 13, 2012 1:30 AM I'd like having 0o777 (and 0b!) but I thought the reason for removing the existing octal literals was that they were surprising and error-prone (and behaving erratically in different settings, so, e.g., 0100 != +"0100").

Re: Object literal methods and generator

2012-01-13 Thread Brendan Eich
Yes, we talked about * before the name (after the imaginary 'function' keyword), see https://mail.mozilla.org/pipermail/es-discuss/2011-October/017314.html /be Herby Vojčík January 13, 2012 2:15 AM Hello! In object literal, one can define method by    method (args) {   

Re: Block lambda is cool, its syntax isn't

2012-01-13 Thread Brendan Eich
Arrows are not a live proposal because TC39 wants to keep LR(1) parsing for grammar validation (checking for ambiguities). We do not have consensus to change and there's no champion working on a credible alternative. I could have dredged them up but they really are not happening, whereas we

Re: Block lambda is cool, its syntax isn't

2012-01-13 Thread Brendan Eich
Quildreen Motta January 13, 2012 5:30 AM Given those above, despite my usual disliking of Ruby syntax, I preferthe pipes over parenthesis, given the latter has an already toooverloaded semantics, such that `{ (foo, bar) (2) }' would look prettyconfusing, at least to

Re: Block lambda is cool, its syntax isn't

2012-01-13 Thread Allen Wirfs-Brock
On Jan 13, 2012, at 6:09 AM, john saylor wrote: hello world! On 01/12/2012 09:09 PM, David Herman wrote: It does help to write a reasonable chunk of code to compare syntaxes for uses of a feature in the wild. Does some enterprising es-discusser wanna take a big JS program with a bunch

Re: Block lambda is cool, its syntax isn't

2012-01-13 Thread Rick Waldron
FWIW, After working through the example gists that I created last night, my opinion changed about the look of Block Lambda's with pipes. As others on the list have said previously and is now very clear to me, pipes provide a very distinct visual cue this is a block lambda, expect X to happen here

Re: Block lambda is cool, its syntax isn't

2012-01-13 Thread john saylor
On 01/13/2012 03:36 PM, Rick Waldron wrote: As others on the list have said previously and is now very clear to me, pipes provide a very distinct visual cue this is a block lambda, expect X to happen here where the {(args) expr } gets lost; these visual cues are important when you're reading and

Re: Block lambda is cool, its syntax isn't

2012-01-13 Thread Brendan Eich
The { and } around the || make it pretty clear the || is not a boolean. Also you can put a space in {| |}. But mainly, as with any alternative bracketing system that uses an infix operator, we are relying on the leading { to make it clear that the immediately following delimiter, | in the

Question about direct proxies syncing their targets

2012-01-13 Thread Tab Atkins Jr.
In the direct proxies proposal at http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies, there's the following line: get: * Invariant checks: * if property exists on target as a data property, updates the target’s property with the returned value Consider an xrange object like from

Re: Question about direct proxies syncing their targets

2012-01-13 Thread David Bruant
Le 14/01/2012 01:57, Tab Atkins Jr. a écrit : In the direct proxies proposal at http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies, there's the following line: get: * Invariant checks: * if property exists on target as a data property, updates the target’s property with the

Re: Question about direct proxies syncing their targets

2012-01-13 Thread Tab Atkins Jr.
On Fri, Jan 13, 2012 at 5:08 PM, David Bruant bruan...@gmail.com wrote: Le 14/01/2012 01:57, Tab Atkins Jr. a écrit : In the direct proxies proposal at http://wiki.ecmascript.org/doku.php?id=harmony:direct_proxies, there's the following line: get:  * Invariant checks:     * if property

Block Lambdas: break and continue

2012-01-13 Thread Grant Husbands
Block lambdas have been a hot topic, recently, but there's a point of significant divergence between Ruby (which appears to be the inspiration) and the proposed solution, in the handling of continue (called 'next', in Ruby) and 'break'. To whit: In Ruby, 'next' will end the current run

Re: Block Lambdas: break and continue

2012-01-13 Thread Brendan Eich
Grant Husbands January 13, 2012 7:29 PM Block lambdas have been a hot topic, recently, but there's a point of significant divergence between Ruby (which appears to be the inspiration) Not Ruby alone, and not in any chauvinist my-language-is-better sense. Smalltalk is

Re: Block Lambdas: break and continue

2012-01-13 Thread Axel Rauschmayer
I think it’s a valid concern. The idea is: If I can implement my own loops (the nice-looking paren-free syntax feeds that illusion!) then I also want those loops to have break and continue. You could statically determine what construct, say, a break applies to and either throw a BreakException (if

Re: Block lambda grammar: BlockArguments

2012-01-13 Thread Axel Rauschmayer
Fixed: http://wiki.ecmascript.org/doku.php?id=strawman:block_lambda_revivaldo=diff The LeftHandSideExpression productions and their kids (NewExpression and CallExpression) are funky and I keep misremembering how NewExpression is what bottoms out via MemberExpression - PrimaryExpression