Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Contracts are fundamentally different from tests. Contracts are abstract specifications about values while tests are concrete specifications about values. The concrete vs abstract distinction is fundamental, as I hope is clear.

That's why Pyret has both tests and contracts (for now, in the form of refinements). This is a distinction that has been explored extensively in Racket also, all fully aware of Eiffel DBC.



Those refinements are nice. Pre- and Post- conditions are illustrated, is there any way to describe an invariant?

Also, maybe you should have called them something else since a lot of people will think about completely different when they hear this word... (http://www.ruby-doc.org/core-2.0.0/doc/syntax/refinements_rd...)


re: refinements nomenclature...

Rebol got there first though! - http://www.rebol.com/r3/docs/datatypes/refinement.html

Matz is known to like Rebol - https://twitter.com/matz_translated/status/25061436079433318...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: