From 660f0ccb6b7e6fff8a6d870b720b5bd0dd6898a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 20 Dec 2021 23:05:05 +0100 Subject: find-extreme on empty list now an error. --- module/calp/util.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module') diff --git a/module/calp/util.scm b/module/calp/util.scm index 96ca2f01..6cee1b0f 100644 --- a/module/calp/util.scm +++ b/module/calp/util.scm @@ -252,8 +252,7 @@ ;; Ord b => (list a) [, (b, b -> bool), (a -> b)] -> a, (list a) (define*-public (find-extreme items optional: (< <) (access identity)) (if (null? items) - ;; Vad fan retunerar man här? - (values #f '()) + (error "Can't find extreme in an empty list") (fold-values (lambda (c min other) (if (< (access c) (access min)) -- cgit v1.2.3