aboutsummaryrefslogtreecommitdiff
path: root/module/vcalendar/control.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-23 18:03:49 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-23 18:03:49 +0200
commit8f4fbcd493e28c86c598efcecdb6dc79d8fe0bfe (patch)
tree37e49d78df0916efcb0d547e0b28b63247cfec3d /module/vcalendar/control.scm
parentChange event-length => event-length/day. (diff)
downloadcalp-8f4fbcd493e28c86c598efcecdb6dc79d8fe0bfe.tar.gz
calp-8f4fbcd493e28c86c598efcecdb6dc79d8fe0bfe.tar.xz
Rename module vcalendar => vcomponent.
Diffstat (limited to 'module/vcalendar/control.scm')
-rw-r--r--module/vcalendar/control.scm39
1 files changed, 0 insertions, 39 deletions
diff --git a/module/vcalendar/control.scm b/module/vcalendar/control.scm
deleted file mode 100644
index a38d678f..00000000
--- a/module/vcalendar/control.scm
+++ /dev/null
@@ -1,39 +0,0 @@
-(define-module (vcalendar control)
- #:use-module (util)
- #:use-module (vcalendar)
- #:export (with-replaced-attrs))
-
-
-(eval-when (expand load) ; No idea why I must have load here.
- (define href (make-procedure-with-setter hashq-ref hashq-set!))
-
- (define (set-temp-values! table component kvs)
- (for-each (lambda (kv)
- (let* (((key val) kv))
- (when (attr component key)
- (set! (href table key) (attr component key))
- (set! (attr component key) val))))
- kvs))
-
- (define (restore-values! table component keys)
- (for-each (lambda (key)
- (and=> (href table key)
- (lambda (val)
- (set! (attr component key) val))))
- keys)))
-
-;;; TODO with-added-attributes
-
-(define-syntax with-replaced-attrs
- (syntax-rules ()
- [(_ (component (key val) ...)
- body ...)
-
- (let ((htable (make-hash-table 10)))
- (dynamic-wind
- (lambda () (set-temp-values! htable component (quote ((key val) ...)))) ; In guard
- (lambda () body ...)
- (lambda () (restore-values! htable component (quote (key ...))))))])) ; Out guard
-
-;;; TODO test that restore works, at all
-;;; Test that non-local exit and return works