diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-12 21:09:35 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-13 04:11:35 +0200 |
commit | 73a4bfc3d8e9bb5365e33a11a6ad3b8340d5195b (patch) | |
tree | e52324edc63a240e5c0b88081c325f789168a4c5 /module/vcomponent/util | |
parent | Document timespec and zic. (diff) | |
download | calp-73a4bfc3d8e9bb5365e33a11a6ad3b8340d5195b.tar.gz calp-73a4bfc3d8e9bb5365e33a11a6ad3b8340d5195b.tar.xz |
Remove custom let*.
While it was nice, the most important part was the multi-valued let from
srfi-71 (which is implemented in srfi-71)). The minor pattern matching
structures could often be replaced with car+cdr, or a propper match.
Diffstat (limited to 'module/vcomponent/util')
-rw-r--r-- | module/vcomponent/util/control.scm | 3 | ||||
-rw-r--r-- | module/vcomponent/util/describe.scm | 3 | ||||
-rw-r--r-- | module/vcomponent/util/group.scm | 4 | ||||
-rw-r--r-- | module/vcomponent/util/instance/methods.scm | 3 |
4 files changed, 8 insertions, 5 deletions
diff --git a/module/vcomponent/util/control.scm b/module/vcomponent/util/control.scm index 586dd4a3..63f1e1e3 100644 --- a/module/vcomponent/util/control.scm +++ b/module/vcomponent/util/control.scm @@ -9,7 +9,8 @@ (define (set-temp-values! table component kvs) (for-each (lambda (kv) - (let* (((key val) kv)) + (let ((key (car kv)) + (val (cadr kv))) (when (prop component key) (set! (href table key) (prop component key)) (set! (prop component key) val)))) diff --git a/module/vcomponent/util/describe.scm b/module/vcomponent/util/describe.scm index 0c3ab27c..703ac73a 100644 --- a/module/vcomponent/util/describe.scm +++ b/module/vcomponent/util/describe.scm @@ -1,5 +1,6 @@ (define-module (vcomponent util describe) :use-module (hnh util) + :use-module (srfi srfi-71) :use-module (vcomponent base) :use-module (text util)) @@ -14,7 +15,7 @@ (format #t "~aBEGIN ~a~%" ii (type vcomponent)) (for-each (lambda (kv) - (let* (((key . values) kv)) + (let ((key values (car+cdr kv))) (define (out vline) (format #t "~a~a = ~a" iii diff --git a/module/vcomponent/util/group.scm b/module/vcomponent/util/group.scm index f328cd18..b8852975 100644 --- a/module/vcomponent/util/group.scm +++ b/module/vcomponent/util/group.scm @@ -14,8 +14,8 @@ stream-null (let loop ((days (day-stream (as-date (prop (stream-car in-stream) 'DTSTART)))) (stream in-stream)) - (let* ((day (stream-car days)) - (tomorow (stream-car (stream-cdr days)))) + (let ((day (stream-car days)) + (tomorow (stream-car (stream-cdr days)))) (let ((head (stream-take-while (ein? day) stream)) (tail diff --git a/module/vcomponent/util/instance/methods.scm b/module/vcomponent/util/instance/methods.scm index 0ad1fdc4..7a1d2fc8 100644 --- a/module/vcomponent/util/instance/methods.scm +++ b/module/vcomponent/util/instance/methods.scm @@ -3,6 +3,7 @@ :use-module (hnh util uuid) :use-module (srfi srfi-1) :use-module (srfi srfi-41) + :use-module (srfi srfi-71) :use-module (srfi srfi-41 util) :use-module (datetime) :use-module (vcomponent base) @@ -100,7 +101,7 @@ (slot-set! this 'events (append #|removed|# remaining))) - (let* ((repeating regular (partition repeating? (slot-ref this 'events)))) + (let ((repeating regular (partition repeating? (slot-ref this 'events)))) (slot-set! this 'fixed-events (sort*! regular date/-time<? (extract 'DTSTART))) (slot-set! this 'repeating-events (sort*! repeating date/-time<? (extract 'DTSTART)))) |