From 4ec130209bcd88ffde56b9b44e2de2c043519ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 2 May 2019 23:44:20 +0200 Subject: Think it's only reintroducing of set! left. --- module/vcomponent.scm | 6 +++--- module/vcomponent/primitive.scm | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/vcomponent.scm b/module/vcomponent.scm index 6df4d7b8..d1a0abff 100644 --- a/module/vcomponent.scm +++ b/module/vcomponent.scm @@ -119,7 +119,7 @@ %vcomponent-set-type!)) (define-public parent %vcomponent-parent) (define-public push-child! %vcomponent-push-child!) -(define-public (attributes component) (map string->symbol (%vcomponent-attribute-list component))) +(define-public attributes %vcomponent-attribute-list) (define-public copy-vcomponent %vcomponent-shallow-copy) @@ -148,7 +148,7 @@ (%vcomponent-make) (let* ((root (%vcomponent-make path)) (component - (case (string->symbol (or (attr root "X-HNH-SOURCETYPE") "no-type")) + (case (or (attr root "X-HNH-SOURCETYPE") 'no-type) ;; == Single ICS file == ;; Remove the abstract ROOT component, ;; returning the wanted VCALENDAR component @@ -166,7 +166,7 @@ ((vdir) (let ((accum (make-vcomponent)) (ch (children root))) - (set! (type accum) "VCALENDAR") + (set! (type accum) 'VCALENDAR) (unless (null? ch) (for key in (attributes (car ch)) diff --git a/module/vcomponent/primitive.scm b/module/vcomponent/primitive.scm index 06b6fd83..53d73652 100644 --- a/module/vcomponent/primitive.scm +++ b/module/vcomponent/primitive.scm @@ -20,3 +20,6 @@ (string-append (dirname (dirname (dirname (current-filename)))) "/lib")) (load-extension "libguile-calendar" "init_lib") + +(define (%vcomponent-attribute-list comp) + (map car (hash-map->list cons (%vcomponent-get-hash-table comp)))) -- cgit v1.2.3