From 6700803cb25f4c35f72e0e0683f53cfc3317f37c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 12 Apr 2022 02:19:19 +0200 Subject: Simplify week-day-name. The out of range exception could never occur, since I aleready limited the interval to (n % 7) + 1. --- module/datetime.scm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'module/datetime.scm') diff --git a/module/datetime.scm b/module/datetime.scm index adff669a..140c05db 100644 --- a/module/datetime.scm +++ b/module/datetime.scm @@ -386,13 +386,7 @@ key: (locale %global-locale)) ;; NOTE this allows days larger than 7 (sunday if counting from monday). - (let ((str (catch 'out-of-range - (lambda () (locale-day (1+ (modulo week-day-number 7)) locale)) - (lambda (oor str num) - (scm-error 'out-of-range "week-day-name" - "~a == (~a % 7) + 1" - (list num week-day-number) - #f))))) + (let ((str (locale-day (1+ (modulo week-day-number 7)) locale))) ;; I also know about the @var{locale-day-short} method, but I need ;; strings of length 2. (if truncate-to -- cgit v1.2.3