diff options
Diffstat (limited to 'module/oop')
-rw-r--r-- | module/oop/goops.scm | 3 | ||||
-rw-r--r-- | module/oop/goops/save.scm | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/module/oop/goops.scm b/module/oop/goops.scm index 34888f7b5..19eb7362b 100644 --- a/module/oop/goops.scm +++ b/module/oop/goops.scm @@ -70,7 +70,7 @@ <vector> <bytevector> <uvec> <foreign> <hashtable> <fluid> <dynamic-state> <frame> <vm> <vm-continuation> <keyword> <syntax> <atomic-box> <thread> <bitvector> - <finalizer> <ephemeron> + <finalizer> <ephemeron> <ephemeron-table> ;; Numbers. <number> <complex> <real> <integer> <fraction> @@ -1081,6 +1081,7 @@ slots as we go." (define-standard-class <bitvector> (<top>)) (define-standard-class <finalizer> (<top>)) (define-standard-class <ephemeron> (<top>)) +(define-standard-class <ephemeron-table> (<top>)) (define-standard-class <thread> (<top>)) (define-standard-class <number> (<top>)) (define-standard-class <complex> (<number>)) diff --git a/module/oop/goops/save.scm b/module/oop/goops/save.scm index 5f0d6457e..6dda93eac 100644 --- a/module/oop/goops/save.scm +++ b/module/oop/goops/save.scm @@ -1,6 +1,6 @@ ;;; installed-scm-file -;;;; Copyright (C) 2000,2001,2002, 2006, 2009, 2010, 2013, 2015, 2020 Free Software Foundation, Inc. +;;;; Copyright (C) 2000,2001,2002, 2006, 2009, 2010, 2013, 2015, 2020, 2025, 2025 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,7 @@ (define-module (oop goops save) #:use-module (ice-9 copy-tree) + #:use-module (ice-9 weak-tables) #:use-module (oop goops internal) #:export (make-unbound save-objects load-objects restore enumerate! enumerate-component! @@ -112,22 +113,22 @@ ;;; Readables ;;; -(define readables (make-weak-key-hash-table 61)) +(define readables (make-weak-key-hash-table #:initial-size 61)) (define-macro (readable exp) `(make-readable ,exp ',(copy-tree exp))) (define (make-readable obj expr) - (hashq-set! readables obj expr) + (weak-key-hash-table-set! readables obj expr) obj) (define (readable-expression obj) - `(readable ,(hashq-ref readables obj))) + `(readable ,(weak-key-hash-table-ref readables obj))) ;; FIXME: if obj is nil or false, this can return a false value. OTOH ;; usually this is only for non-immediates. (define (readable? obj) - (hashq-ref readables obj)) + (weak-key-hash-table-ref readables obj)) ;;; ;;; Writer helpers |