diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-05-01 18:14:13 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-05-01 18:14:13 +0200 |
commit | c8317f28aaec140bf9854b3a021d8dac78abe395 (patch) | |
tree | e408b621a117a3957e62bd68f8d796637b0a1273 /module/vcomponent.scm | |
parent | X-WR-CALNAME and COLOR attr in VCALENDAR now respected. (diff) | |
download | calp-c8317f28aaec140bf9854b3a021d8dac78abe395.tar.gz calp-c8317f28aaec140bf9854b3a021d8dac78abe395.tar.xz |
Add names to components of 'attr'.
Diffstat (limited to '')
-rw-r--r-- | module/vcomponent.scm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/module/vcomponent.scm b/module/vcomponent.scm index e052f97e..4ef8f794 100644 --- a/module/vcomponent.scm +++ b/module/vcomponent.scm @@ -86,11 +86,16 @@ (define-public attr* get-attr) +(define (get-first c a) + (and=> (car (get-attr c a)) car)) + +(define (set-first! c a v) + (and=> (car (get-attr c a)) + (lambda (f) (set! (car f) v)))) + (define-public attr (make-procedure-with-setter - (lambda (c a) (and=> (car (get-attr c a)) car)) - (lambda (c a v) (and=> (car (get-attr c a)) - (lambda (f) (set! (car f) v)))))) + get-first set-first!)) ;; value ;; (define-public v |