From 8f4fbcd493e28c86c598efcecdb6dc79d8fe0bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 23 Apr 2019 18:03:49 +0200 Subject: Rename module vcalendar => vcomponent. --- module/vcalendar/control.scm | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 module/vcalendar/control.scm (limited to 'module/vcalendar/control.scm') 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 -- cgit v1.2.3