▲ | peterashford 2 days ago | |
I think they were introduced with Eiffel, which was all about design by contract | ||
▲ | johnisgood 2 days ago | parent [-] | |
Ada has that too, for what it is worth: https://learn.adacore.com/courses/intro-to-ada/chapters/cont... and https://en.wikibooks.org/wiki/Ada_Programming/Contract_Based.... It can be verified at compile time. But what I love the most is: https://news.ycombinator.com/item?id=43936007 Instead of:
You can do this, in Ada:
or alternatively:
and then you can use attributes such as:
Does D have anything like this? Or do any other languages? |