From f5f363694506edaf50eb1c1f1e1001b94e1d5d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 1 May 2019 16:22:17 +0200 Subject: 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. --- module/vcomponent/output.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/vcomponent') 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))))) -- cgit v1.2.3