From e13f6bb201dff690208b9cc951b5c098b0d63356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 3 Oct 2019 00:46:01 +0200 Subject: Slowly going through and fixing everything. --- module/vcomponent/base.scm | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'module/vcomponent') diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm index 4b49ba66..395c2d9c 100644 --- a/module/vcomponent/base.scm +++ b/module/vcomponent/base.scm @@ -6,8 +6,9 @@ :use-module ((ice-9 optargs) :select (define*-public))) (define (get-attr component attr) - (hash-ref (struct-ref component 3) - (as-string attr)) + (and=> (hash-ref (struct-ref component 3) + (as-string attr)) + (lambda (l) (struct-ref l 0))) #; (%vcomponent-get-attribute component @@ -19,26 +20,29 @@ (set! (car (get-attr component (as-string attr))) value)) -(define-public value caar) +;; (define-public value caar) -(define-public (values-left-count attr-list) - (length (take-while identity attr-list))) +;; (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-public (value-count attr-list) +;; (length (take-while identity (cdr (drop-while identity attr-list))))) (define-public attr* get-attr) -(define (get-first c a) - (and=> (car (get-attr c a)) car)) +;; (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 (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-first set-first! + get-attr + set-attr! + )) (define-public prop @@ -64,7 +68,7 @@ ) (define*-public (children component #:optional only-type) - (let ((childs (slot-ref component 1))) + (let ((childs (struct-ref component 1))) (if only-type (filter (lambda (e) (eq? only-type (type e))) childs) childs))) -- cgit v1.2.3