3 ms·
I think this kind of things is much more suitable to be implemented via macros because 1) it can be implemented with much nicer syntax not abusing function synt
by andreypopp 13y ago
I think this kind of things is much more suitable to be implemented via macros because 1) it can be implemented with much nicer syntax not abusing function syntax and 2) it can be done at compile time (I mean true compile time, not in browser).
Consider the following syntax:
// values to inject
var registry = {
scope: ...
http: ...
}
inject http, scope {
http.get('/search', {query: scope.query}).then(render);
}
all of these can be done today with sweet.js[1] — see the example http://bit.ly/1bjdxWJ http://bit.ly/1bjdxWJ
[1]: http://sweetjs.org http://sweetjs.org