Expression closures - use-cases for shortcut lambda syntax (blocks)

Neil Mix nmix at
Thu Mar 15 21:59:09 PDT 2007

> I am warming up to this use of backslash. What do others think?

I like it.

Although (prepare for gratuitous land grab), I have to say one of my  
top coding typos with lambda-as-argument is failing to remember the  
closing paren.  It would be *really* nice if by syntactic sugar a  
block following a function call was converted into a lambda parameter  
at the end of the arguments list, so that:

	ajax(url, \(response) {
		// do something

could become:

	ajax(url) {
		var [response] = arguments;
		// do something

Even though my version has more characters due to the arguments  
destructuring, I'd gladly trade that off for the enhanced readability.


More information about the Es4-discuss mailing list