aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/base.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2020-01-22 00:07:40 +0100
committerHugo Hörnquist <hugo@hornquist.se>2020-01-22 00:07:40 +0100
commitbed02b0f5408c5f3132a9c96f4772a2bd5cfaec5 (patch)
tree675883d5dda284c79b1867885e4c5a50c7053444 /module/vcomponent/base.scm
parentMinor comments. (diff)
downloadcalp-bed02b0f5408c5f3132a9c96f4772a2bd5cfaec5.tar.gz
calp-bed02b0f5408c5f3132a9c96f4772a2bd5cfaec5.tar.xz
Add bettyr vcomponent record printer.
Diffstat (limited to 'module/vcomponent/base.scm')
-rw-r--r--module/vcomponent/base.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm
index bf15510d..f93952ca 100644
--- a/module/vcomponent/base.scm
+++ b/module/vcomponent/base.scm
@@ -28,6 +28,14 @@
(attributes get-component-attributes))
(export vcomponent? children type)
+((@ (srfi srfi-9 gnu) set-record-type-printer!)
+ <vcomponent>
+ (lambda (c p)
+ (format p "#<<vcomponent> ~a, len(child)=~a, parent=~a>~%"
+ (type c)
+ (length (children c))
+ (and=> (get-component-parent c) type))))
+
;; TODO should this also update the parent
(define-public parent
(make-procedure-with-setter