From bed02b0f5408c5f3132a9c96f4772a2bd5cfaec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 22 Jan 2020 00:07:40 +0100 Subject: Add bettyr vcomponent record printer. --- module/vcomponent/base.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'module/vcomponent/base.scm') 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!) + + (lambda (c p) + (format p "#< ~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 -- cgit v1.2.3