> set(User, function() { return {name: "John"}; }, silent: true);<p>That's not even valid JavaScript, so I would not expect that. It is also somewhat standard that lambda-like operators eat as many tokens as possible.<p>But I agree with many points. The anonymous function sugar is extremely handy in callback-oriented programming. I wonder if a small syntax extension to JS, consisting of Python like indetation and Ruby like blocks would ease the biggest pains:<p><pre><code> function f(some_param, callback)
bla()
return 1
f(10) |u,t| ->
callback_code_here
</code></pre>
The call to f would receive the anonymous callback as its last argument. Callbacks in other positions, or multiple callbacks could be named:<p><pre><code> f(10, success, failure)
succss: |data| ->
console.log("Success!", data)
failure: |error| ->
console.log("Error: ", error)</code></pre>