From 8d5a6ff925ff91cced886654ab271f2243f29caf Mon Sep 17 00:00:00 2001 From: Darren Bane Date: Sun, 7 Jun 2020 00:09:49 +0100 Subject: Making changes --- dbc.lsp | 4 +++- doc/breaking_rules.md | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dbc.lsp b/dbc.lsp index 3429896..48f1d6f 100644 --- a/dbc.lsp +++ b/dbc.lsp @@ -3,8 +3,10 @@ ;; (set-dynamic *use-contract* nil) (defcontract average-of-absolutes (values) (:in () - (> (length values) 0)) + (assure values) + (> (length values) 0)) ; Redundant? (:out (res) + (assure res) (>= res 0)) (quotient (reduce #'+ (map ' #'abs values)) (length values))) ;; (average-of-absolutes '(1 3)) diff --git a/doc/breaking_rules.md b/doc/breaking_rules.md index 7933efb..5061df7 100644 --- a/doc/breaking_rules.md +++ b/doc/breaking_rules.md @@ -38,6 +38,11 @@ pitman 1994 \.] . +*NB*: I am almost certainly re-inventing a SmallTalk wheel. However I +argue that Lisp's combination of imperative & OO has been validated by +industry whereas pure OO as in SmallTalk (or logic programming as in +Prolog) is still niche. + A closely related are is that of "specification animation", quickly writing an implementation of some subset of a formal specification in for example Z or VDM. -- cgit 1.4.1-2-gfad0