Javascript-compatible syntax
Closed this issue · 5 comments
indutny commented
Now:
template(this.x === '1' && this.y === '2') {
var x = apply();
return x + local(this.y = 3) applyNext();
}
Should be:
template(this.x === '1', this.y === '2')(function() {
var x = apply(this)();
return x + local(this)({ y: 3 })(function() {
return applyNext(this)();
});
});
Basics
template(pred1, pred2, ..., pred3)(body)
local(context)(local_change1, ..., local_changeN)
apply(context)(local_change1, ..., local_changeN)
indutny commented
Example of runtime: https://gist.github.com/8b8d86fcad29a1bd19d2
veged commented
local
can be written as local()(local_change1, ..., local_changeN)(bodyFunction)
(use this
as default context).
apply
better live without context argument (is most common case) and for custom context apply we can use local
+apply
veged commented
В какой версии это уже есть? Тикет можно же закрыть?
indutny commented
В 0.7.x, сейчас смержу в мастер.