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

Vassily Gavrilyak gavrilyak at
Fri Mar 16 15:18:41 PDT 2007

Jeff, concerning who are 'sophisticated' users.

Ruby and Smalltalk and Perl users found nothing sophisticated with blocks.
And most of those users are web-developers, so they will need to deal with
ES anyway.
They are even considered less sophisticated then 'real' Java/C++ developers,
cause of scripting nature.

About current ES user base.
Is seams that most JS libs use (function(){}) trick for namespaces and
function callbacks for AJAX calls.
People are already using the closures and carefully counting the ()s.
Well, actually text editors count them :-).  But that's about writing.
When reading  I do not look at the separators,  just  the  words and
indentation,  and ocasional meaningless
'function' keyword in 'wrong' just breaks the words reading process.

Syntax could be much clearer and I (and most scripters) would be very happy
to have clear blocks like in Ruby."file.txt") do  | file

or Groovy's"file"){ file->
Or C#  3
C# 3.0 Specification"file", (file))=>{

But first is not-ES and second is broken with auto semicolon insertion.
May be C# way will be good, and C# is ECMA too. It has the same superfluous
() as ES3, but looks good.
It seems harder to implement and probably can break some syntax, but C# user
base is huge.
Unfortunately I have no better ideas of clear syntax. Seems any nice idea
will break something in current syntax.
Hope it will be born is this discussion.

Vassily Gavrilyak
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Es4-discuss mailing list