Contracts For CoffeeScript
disnetdev.com
Contracts For CoffeeScript
1–10 of 36 posts
Re: Contracts For CoffeeScript
#2Re: Contracts For CoffeeScript
#3This is just static types
isEven = (x) ->
x % 2 is 0
f :: (!isOdd) -> !isEven
f = (x) -> ...Re: Contracts For CoffeeScript
#4This is just static types
Re: Contracts For CoffeeScript
#5Re: Contracts For CoffeeScript
#6Re: Contracts For CoffeeScript
#7Re: Contracts For CoffeeScript
#8This Lambda The Ultimate discussion on Benjamin C. Pierce's (Types And Programming Languages) talk Types Considered Harmful is also of interest - the gist being that contracts are useful because sometimes static types are just too damn hard - http://lambda-the-ultimate.org/node/2828
EDIT: Might as well link to Brendan Eich's talk Proxies Are Awesome!, http://www.slideshare.net/BrendanEich/metaprog-5303821. I haven't really been following the Proxy thing and they seem quite useful. It's nice to see them applied so powerfully here.
Re: Contracts For CoffeeScript
#9Re: Contracts For CoffeeScript
#10Earlier quoted context omitted.
Not hardly. The runtime can detect that a function invocation violates a post-condition only after all of that function's side-effects have been run.
What's your point?
There are good uses for static type checkers and design by contract, but neither one is a good substitute for the other.