by ArchD · 13y ago · 0 comments
Otherwise, the original code could just totally disappear after multiple runs. What good is non-buggy code if it does nothing? Failure to perform the user's requirement at all is also a bug. Not having the original code that you can at least edit to fix is rather pointless, especially when vigil doesn't indicate the callers of the offending functions, because next time you run vigil, those will get deleted. Besides, if foo()'s failure is completely due to bar()'s failure to fulfill its 'swear', it's foo()'s failure is not really its bug.
On a serious note, what you're thinking of is contracts, like so[0]
Macros would be deviating from core JS too much to fit with CoffeeScript's goal. Just happens that the compiler is nicely hackable to allow for these projects.
Not to say I object to the idea of an expanded CoffeeScript, just that it should be a fork.
http://disnetdev.com/blog/2012/10/14/hygienic-macros-for-jav...
and http://brendaneich.github.com/Strange-Loop-2012/#/40 http://www.infoq.com/presentations/State-JavaScript
I believe this would make it no different from an 'assert'.