Post #1782102
2026-04-22 07:29 UTC
@screwlisp I've been looking at Liskov & Guttag's books, & it's kind of remarkable how they're reaching for an idea but it's not there yet.
Eiffel's Design By Contract is their %REQUIRES comments, but actually does something. Most languages have an assert feature that makes it easy to do the pre-condition but only Eiffel relibably wraps the post-condition.
The understanding of Pascal & later Java is… not normative. This is not how you make a search in Pascal:
Replies (1)
-
@mdhughes@appdot.net 2026-04-22 07:40
@screwlisp Normal Pascal: function search_ints(a: int_array; x: INTEGER): INTEGER { for loop or whatever, return i, or -1 for not found } At most you might make a TYPE search_result with BOOLEAN & INT fields. The Java book which came out YEARS after java.util.collections, claims there's no iteration & implements a very weird iterator there, too. Talks about testing, but never presents a test case or runner, I think they only do whole-program testing. Write some inputs, see what it does.