aboutsummaryrefslogtreecommitdiff
path: root/module/util.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2020-01-24 20:22:49 +0100
committerHugo Hörnquist <hugo@hornquist.se>2020-01-24 20:22:49 +0100
commit444582f0269c4122b0b388468765b3fa7dbc7b89 (patch)
tree224edb5ce01222041300808ea357fc56b28a04c8 /module/util.scm
parentAdd swap. (diff)
downloadcalp-444582f0269c4122b0b388468765b3fa7dbc7b89.tar.gz
calp-444582f0269c4122b0b388468765b3fa7dbc7b89.tar.xz
Extend define-many to allow a custom define procedure.
Diffstat (limited to 'module/util.scm')
-rw-r--r--module/util.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/module/util.scm b/module/util.scm
index 0580748f..a2ab43c3 100644
--- a/module/util.scm
+++ b/module/util.scm
@@ -258,9 +258,13 @@
(define-syntax define-many
(syntax-rules ()
[(_) (begin)]
+ [(_ def) (begin)]
[(_ (symbols ...) value rest ...)
(begin (define symbols value) ...
- (define-many rest ...))]))
+ (define-many rest ...))]
+ [(_ def (symbols ...) value rest ...)
+ (begin (def symbols value) ...
+ (define-many def rest ...))]))
;; This function borrowed from web-ics (calendar util)
(define* (sort* items comperator #:optional (get identity))
@@ -388,7 +392,6 @@
[(-> obj func rest ...)
(-> (func obj) rest ...)]))
-
;; Non-destructive set, syntax extension from set-fields from (srfi
;; srfi-9 gnu). Also doubles as a non-destructive mod!, if the `='
;; operator is used.