diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-05-01 16:22:17 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-05-01 16:22:50 +0200 |
commit | f5f363694506edaf50eb1c1f1e1001b94e1d5d1c (patch) | |
tree | 0096a895608c7554b2e5ee8bf7ea978d5816a642 /module/vcomponent/output.scm | |
parent | Change .hidelink to color: inherit. (diff) | |
download | calp-f5f363694506edaf50eb1c1f1e1001b94e1d5d1c.tar.gz calp-f5f363694506edaf50eb1c1f1e1001b94e1d5d1c.tar.xz |
Change how attributes are fetched.
Previous version failed when an attribute contained a list. This fixes
that, by always returning a circular list, delimited with #f when it
loops. Methods for moving through this list is currently lacking.
Diffstat (limited to '')
-rw-r--r-- | module/vcomponent/output.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/module/vcomponent/output.scm b/module/vcomponent/output.scm index 6d346230..f55adf3b 100644 --- a/module/vcomponent/output.scm +++ b/module/vcomponent/output.scm @@ -21,7 +21,7 @@ (begin body ...) (if pred-value STR-RESET "")))) -(define* (print-vcomponent comp #:optional (port #t) #:key (depth 0)) +(define* (print-vcomponent comp #:optional (port #t) #:key (descend? #t) (depth 0)) (let ((kvs (map (lambda (key) (cons key (attr* comp key))) (attributes comp)))) (format port "~a <~a> :: ~:a~%" @@ -34,8 +34,9 @@ key (concatenate (hash-map->list list (cdr at))) (v at)))) - (for-each (lambda (e) (print-vcomponent e port #:depth (1+ depth))) - (children comp)))) + (if descend? + (for-each (lambda (e) (print-vcomponent e port #:descend? #t #:depth (1+ depth))) + (children comp))))) |