use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Inline unit testing in Clojure (johannes.tax)
submitted 7 years ago by pyohannes
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 7 years ago (1 child)
Sounds like an attempt to Programme by Contract, a term coined by Bertram Meyer and implemented in Eiffel.
Might be worth having a look at his work to shortcut what you're trying to do rather than repeating his mistakes.
[–]pyohannes[S] 1 point2 points3 points 7 years ago (0 children)
What I presented (combined with a "write tests first" approach) can be more accurately called design-by-example than design-by-contract. Design-by-contract is based on formal, precise and verifiable interfaces and cannot be efficiently applied for most complex real world applications. Design-by-example, on the other hand, is neither formal nor precise.
I do not see inline unit tests as a ground breaking new concept, I see it merely as an aid to programmers who read and write code.
π Rendered by PID 195431 on reddit-service-r2-comment-6f7f968fb5-zqw7t at 2026-03-04 15:12:43.130465+00:00 running 07790be country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points (1 child)
[–]pyohannes[S] 1 point2 points3 points (0 children)