diff options
author | Leah Neukirchen <leah@vuxu.org> | 2022-11-01 22:50:45 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2022-11-01 22:50:45 +0100 |
commit | 7288e28b8179b4e9e96bff50e31b88b8cab2edc9 (patch) | |
tree | bb991abed3f533ed96a28163843cc5f2f9072437 | |
parent | a5892920175dc7d5cf5b25a26b06476d7ef0b9fd (diff) | |
download | mew-7288e28b8179b4e9e96bff50e31b88b8cab2edc9.tar.gz mew-7288e28b8179b4e9e96bff50e31b88b8cab2edc9.tar.xz mew-7288e28b8179b4e9e96bff50e31b88b8cab2edc9.zip |
list-ref-default: fix logic
-rw-r--r-- | mew.scm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mew.scm b/mew.scm index 02d0dd5..a623b74 100644 --- a/mew.scm +++ b/mew.scm @@ -212,11 +212,11 @@ (while (not cond) body ...)))) (define (list-ref-default l i default) - (if (zero? i) - (if (null? l) - default - (car l)) - (list-ref-default (cdr l) (- i 1) default))) + (if (null? l) + default + (if (zero? i) + (car l) + (list-ref-default (cdr l) (- i 1) default)))) (define (vector-ref-default v i default) (if (< i (vector-length v)) |