The correspondence principle is a big change for the body, so even if we could reserve block or abuse do, making the special form look like function (params) { body } is a mistake. 'return' does not return from the block, it returns from the enclosing function.

I'm not in love with Ruby syntax but {(a, b) a + b} isn't as distinctive and clearly a lambda-like thing. You're right about that, but turning back to function-based syntax with a different introductory keyword goes the wrong direction. This is why I keep coming back to "different syntax is a virtue". The correspondence-principle-based semantics are different enough.

/be

January 12, 2012 5:44 PM

I agree. While Ruby and Smalltalk are useful to continue mining for
ideas, they shouldn't be a source of syntax, as they're not
super-popular. Using || to denote an argument list looks *bizarre* to
my eyes, and I suspect also to the eyes of every single person who's
used a C-like language but not Ruby.

I'm not wedded to {(a,b) a + b} for blocks either, but it's at least
an improvement over {|a,b| a + b}. I wouldn't mind something simple
like "block(a,b){a+b}" or even "do(a,b){a+b}", though those probably
run into ambiguity issues.

~TJ
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to