~ chicken-core (chicken-5) 5b2564ab28ce1dc90244090bfc969b6c6d03e8b0


commit 5b2564ab28ce1dc90244090bfc969b6c6d03e8b0
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Thu Jul 27 07:46:23 2017 +1200
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Sun Aug 6 17:21:19 2017 +0200

    Add chicken.plist module
    
    Signed-off-by: Peter Bex <peter@more-magic.net>

diff --git a/README b/README
index 3f97e813..75f51e0a 100644
--- a/README
+++ b/README
@@ -310,6 +310,7 @@ _/        _/    _/    _/    _/        _/  _/    _/        _/    _/_/
 	|   |       |-- chicken.memory.import.so
 	|   |       |-- chicken.pathname.import.so
 	|   |       |-- chicken.platform.import.so
+	|   |       |-- chicken.plist.import.so
 	|   |       |-- chicken.port.import.so
 	|   |       |-- chicken.posix.import.so
 	|   |       |-- chicken.pretty-print.import.so
diff --git a/chicken.import.scm b/chicken.import.scm
index 806d2820..563cf7ff 100644
--- a/chicken.import.scm
+++ b/chicken.import.scm
@@ -109,13 +109,11 @@
    (fxxor . chicken.fixnum#fxxor)
    (fxlen . chicken.fixnum#fxlen)
    gensym
-   get
    (get-call-chain . chicken.condition#get-call-chain)
    (get-condition-property . chicken.condition#get-condition-property)
    get-environment-variable
    (get-line-number . chicken.syntax#get-line-number)
    get-output-string
-   get-properties
    getter-with-setter
    implicit-exit-handler
    infinite?
@@ -155,12 +153,10 @@
    procedure-information
    program-name
    promise?
-   put!
    quotient&modulo
    quotient&remainder
    ratnum?
    (register-feature! . chicken.platform#register-feature!)
-   remprop!
    rename-file
    (repository-path . chicken.platform#repository-path)
    (require . chicken.load#require)
@@ -182,7 +178,6 @@
    subvector
    symbol-append
    symbol-escape
-   symbol-plist
    (syntax-error . chicken.syntax#syntax-error)
    system
    (unregister-feature! . chicken.platform#unregister-feature!)
diff --git a/defaults.make b/defaults.make
index 0504b93d..8b072088 100644
--- a/defaults.make
+++ b/defaults.make
@@ -267,7 +267,7 @@ PRIMITIVE_IMPORT_LIBRARIES = chicken chicken.condition chicken.csi chicken.forei
 DYNAMIC_IMPORT_LIBRARIES = srfi-4
 DYNAMIC_CHICKEN_IMPORT_LIBRARIES = bitwise blob errno file.posix	\
 	fixnum flonum format gc io keyword load locative memory		\
-	platform posix pretty-print process process.signal		\
+	platform plist posix pretty-print process process.signal	\
 	process-context random syntax time time.posix
 DYNAMIC_CHICKEN_COMPILER_IMPORT_LIBRARIES = user-pass
 DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES = continuation data-structures \
diff --git a/distribution/manifest b/distribution/manifest
index 57f19f46..56ceddb4 100644
--- a/distribution/manifest
+++ b/distribution/manifest
@@ -316,6 +316,8 @@ chicken.pathname.import.scm
 chicken.pathname.import.c
 chicken.platform.import.scm
 chicken.platform.import.c
+chicken.plist.import.scm
+chicken.plist.import.c
 chicken.port.import.scm
 chicken.port.import.c
 chicken.posix.import.scm
diff --git a/library.scm b/library.scm
index e4ed6312..a75e77a9 100644
--- a/library.scm
+++ b/library.scm
@@ -5608,6 +5608,11 @@ EOF
 
 ;;; Property lists
 
+(module chicken.plist
+  (get get-properties put! remprop! symbol-plist)
+
+(import scheme chicken)
+
 (define (put! sym prop val)
   (##sys#check-symbol sym 'put!)
   (##core#inline_allocate ("C_a_i_putprop" 8) sym prop val) )
@@ -5670,6 +5675,8 @@ EOF
 	      (values prop (##sys#slot tl 0) nxt)
 	      (loop nxt) ) ) ) ) )
 
+) ; chicken.plist
+
 
 ;;; Print timing information (support for "time" macro):
 
diff --git a/rules.make b/rules.make
index c425f855..a4faa94b 100644
--- a/rules.make
+++ b/rules.make
@@ -512,6 +512,7 @@ $(eval $(call declare-emitted-import-lib-dependency,chicken.flonum,library))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.gc,library))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.keyword,library))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.platform,library))
+$(eval $(call declare-emitted-import-lib-dependency,chicken.plist,library))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.time,library))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.load,eval))
 $(eval $(call declare-emitted-import-lib-dependency,chicken.format,extras))
@@ -615,6 +616,7 @@ support.c: support.scm mini-srfi-1.scm \
 		chicken.keyword.import.scm \
 		chicken.pathname.import.scm \
 		chicken.platform.import.scm \
+		chicken.plist.import.scm \
 		chicken.port.import.scm \
 		chicken.pretty-print.import.scm \
 		chicken.random.import.scm \
@@ -780,6 +782,7 @@ library.c: $(SRCDIR)library.scm $(SRCDIR)banner.scm $(SRCDIR)common-declarations
 	-emit-import-library chicken.gc \
 	-emit-import-library chicken.keyword \
 	-emit-import-library chicken.platform \
+	-emit-import-library chicken.plist \
 	-emit-import-library chicken.time
 internal.c: $(SRCDIR)internal.scm $(SRCDIR)mini-srfi-1.scm
 	$(bootstrap-lib) -emit-import-library chicken.internal
diff --git a/support.scm b/support.scm
index 8a343315..158cae2f 100644
--- a/support.scm
+++ b/support.scm
@@ -88,6 +88,7 @@
 	chicken.keyword
 	chicken.pathname
 	chicken.platform
+	chicken.plist
 	chicken.port
 	chicken.pretty-print
 	chicken.random
diff --git a/types.db b/types.db
index a0f6e212..7e685404 100644
--- a/types.db
+++ b/types.db
@@ -1197,12 +1197,8 @@
 
 (gensym (#(procedure #:clean) gensym (#!optional (or string symbol)) symbol))
 
-(get (#(procedure #:clean #:enforce) get (symbol symbol #!optional *) *)
-     ((symbol symbol *) (##core#inline "C_i_getprop" #(1) #(2) #(3))))
-
 (get-environment-variable (#(procedure #:clean #:enforce) get-environment-variable (string) *))
 (get-output-string (#(procedure #:clean #:enforce) get-output-string (output-port) string))
-(get-properties (#(procedure #:clean #:enforce) get-properties (symbol list) symbol * list))
 
 ;; keyword
 
@@ -1241,6 +1237,17 @@
 (chicken.platform#repository-path (#(procedure #:clean) chicken.platform#repository-path (#!optional *) *))
 (chicken.platform#installation-repository (#(procedure #:clean) chicken.platform#installation-repository (#!optional *) *))
 
+;; plist
+
+(chicken.plist#get (#(procedure #:clean #:enforce) chicken.plist#get (symbol symbol #!optional *) *)
+		   ((symbol symbol *) (##core#inline "C_i_getprop" #(1) #(2) #(3))))
+(chicken.plist#get-properties (#(procedure #:clean #:enforce) chicken.plist#get-properties (symbol list) symbol * list))
+(chicken.plist#put! (#(procedure #:clean #:enforce) chicken.plist#put! (symbol symbol *) undefined)
+		    ((symbol symbol *)
+		     (##core#inline_allocate ("C_a_i_putprop" 8) #(1) #(2) #(3))))
+(chicken.plist#remprop! (#(procedure #:clean #:enforce) chicken.plist#remprop! (symbol symbol) undefined))
+(chicken.plist#symbol-plist (#(procedure #:clean #:enforce) chicken.plist#symbol-plist (symbol) list)
+			    ((symbol) (##sys#slot #(1) '2)))
 
 (getter-with-setter
  (#(procedure #:clean #:enforce)
@@ -1284,11 +1291,6 @@
 (make-promise (#(procedure #:enforce) make-promise (*) (struct promise))
               (((struct promise)) #(1)))
 
-(put! (#(procedure #:clean #:enforce) put! (symbol symbol *) undefined)
-      ((symbol symbol *)
-       (##core#inline_allocate ("C_a_i_putprop" 8) #(1) #(2) #(3))))
-
-(remprop! (#(procedure #:clean #:enforce) remprop! (symbol symbol) undefined))
 (rename-file (#(procedure #:clean #:enforce) rename-file (string string) string))
 (reset (procedure reset () noreturn))
 (reset-handler (#(procedure #:clean #:enforce) reset-handler (#!optional (procedure () . *)) procedure))
@@ -1338,9 +1340,6 @@
 (subvector (forall (a) (#(procedure #:clean #:enforce) subvector ((vector-of a) fixnum #!optional fixnum) (vector-of a))))
 (symbol-escape (#(procedure #:clean) symbol-escape (#!optional *) *))
 
-(symbol-plist (#(procedure #:clean #:enforce) symbol-plist (symbol) list)
-	      ((symbol) (##sys#slot #(1) '2)))
-
 (system (#(procedure #:clean #:enforce) system (string) fixnum))
 (vector-resize
  (forall (a b) (#(procedure #:clean #:enforce) vector-resize ((vector-of a) fixnum #!optional b)
Trap