diff options
-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 |