aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-05-01 18:14:13 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2019-05-01 18:14:13 +0200
commitc8317f28aaec140bf9854b3a021d8dac78abe395 (patch)
treee408b621a117a3957e62bd68f8d796637b0a1273
parentX-WR-CALNAME and COLOR attr in VCALENDAR now respected. (diff)
downloadcalp-c8317f28aaec140bf9854b3a021d8dac78abe395.tar.gz
calp-c8317f28aaec140bf9854b3a021d8dac78abe395.tar.xz
Add names to components of 'attr'.
-rw-r--r--module/vcomponent.scm11
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