From feefb97cf9118c8e5d7018e33887a371dadc5eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 6 Oct 2019 13:35:20 +0200 Subject: Minor cleanup in scheme code. --- module/vcomponent/base.scm | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'module/vcomponent/base.scm') diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index 246566ee..69fab656 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -6,6 +6,8 @@ :use-module (ice-9 hash-table) :use-module ((ice-9 optargs) :select (define*-public))) +(export add-child!) + ;; vline → value (define-public value (make-procedure-with-setter @@ -29,25 +31,10 @@ (as-string attr) (make-vline value)))) -;; (define-public (values-left-count attr-list) -;; (length (take-while identity attr-list))) - -;; (define-public (value-count attr-list) -;; (length (take-while identity (cdr (drop-while identity attr-list))))) - -;; (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 -; get-first set-first! get-attr - set-attr! - )) + set-attr!)) (define-public prop @@ -68,11 +55,9 @@ )) (define-public (parent c) (struct-ref c 2)) -(define-public push-child! add-child!) + (define-public (attributes component) - (hash-map->list cons (struct-ref component 3)) - #; (map string->symbol (%vcomponent-attribute-list component)) - ) + (hash-map->list cons (struct-ref component 3))) (define*-public (children component) (struct-ref component 1)) @@ -92,8 +77,6 @@ (hash-map->list (lambda (key value) (cons key (copy-vline value))) (struct-ref component 3))))) -;; (define-public filter-children! %vcomponent-filter-children!) - (define-public (extract field) (lambda (e) (attr e field))) -- cgit v1.2.3