[e-lang] Naming convention for variable holding an eventual reference
Tyler Close
tyler.close at gmail.com
Fri May 16 18:31:14 CDT 2008
Another advantage of routing all invocations through a global Q object
is that we can reserve the API on the promise objects. In the event
that Javascript ever becomes an actual dynamic language with a
doesNotUnderstand handler, we can upgrade to the syntax we'd really
like:
var page_ = _.connect(window.location.toString())
var drum_ = page_.subject()
var hits_ = drum_.getHits()
drum_.bang(1)
_.when(drum_.getHits(), function (value) {
print(value);
}, function (reason) {
print('rejected: ' + reason);
})
hits_ = drum_.bang(3).getHits()
Which is much like the syntax we have in the version of the ref_send
API for Java, a much better dynamic language than Javascript. ;)
--Tyler
More information about the e-lang
mailing list