aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/util/control.scm
blob: 9ef93c30202f3934c30c7c1ec7125b8b3e84ab8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(define-module (vcomponent util control)
  :use-module ((vcomponent) :select (prop))
  :use-module ((srfi srfi-1) :select (fold))
  :export (with-replaced-properties))

(define-syntax with-replaced-properties
  (syntax-rules ()
    [(_ (component (key val) ...)
        body ...)

     (let ((component
            (fold (lambda (pair component)
                    (prop component (car pair) (cdr pair)))
                  component
                  (list (cons (quote key) val) ...))))
       body ...)]))