diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2019-05-22 22:04:50 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2019-05-22 22:04:50 +0200 |
commit | f575740684715d3de606b37f114d4f215c66c797 (patch) | |
tree | f4cf2f979d6011dabb283096f5b172ce89d39fda /module/util.scm | |
parent | Fix git version parsing. (diff) | |
download | calp-f575740684715d3de606b37f114d4f215c66c797.tar.gz calp-f575740684715d3de606b37f114d4f215c66c797.tar.xz |
Add support for events without DTEND set.
Diffstat (limited to 'module/util.scm')
-rw-r--r-- | module/util.scm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/module/util.scm b/module/util.scm index c41b8061..89f6dab6 100644 --- a/module/util.scm +++ b/module/util.scm @@ -2,6 +2,7 @@ #:use-module (srfi srfi-1) #:use-module ((ice-9 optargs) #:select (define*-public)) #:use-module ((sxml fold) #:select (fold-values)) + #:use-module (srfi srfi-9 gnu) #:export (for define-quick-record mod! sort* sort*! mod/r! set/r! @@ -10,6 +11,7 @@ quote? re-export-modules use-modules* + -> set tree-map let-lazy) #:replace (let* set! define-syntax when unless if)) @@ -342,3 +344,23 @@ (map (lambda (sub) (list (car form) sub)) (cadr form))) forms)))) + + + +(define-syntax -> + (syntax-rules () + [(-> obj) obj] + [(-> obj (func args ...) rest ...) + (-> (func obj args ...) rest ...)] + [(-> obj func rest ...) + (-> (func obj) rest ...)])) + + +(define-syntax set + (syntax-rules (=) + [(set (acc obj) value) + (set-fields + obj ((acc) value))] + [(set (acc obj) = (op rest ...)) + (set-fields + obj ((acc) (op (acc obj) rest ...)))])) |