projects
/
8sync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add daydream.scm and re-enable some files in Makefile.am.
[8sync.git]
/
8sync
/
rmeta-slot.scm
diff --git
a/8sync/rmeta-slot.scm
b/8sync/rmeta-slot.scm
index de85ee9cae7d179b17ee6b04ca0a71a7036d899e..a9179ba56718492d03e4817f1d9ac942a1b5d031 100644
(file)
--- a/
8sync/rmeta-slot.scm
+++ b/
8sync/rmeta-slot.scm
@@
-21,7
+21,8
@@
#:use-module (srfi srfi-9)
#:use-module (ice-9 match)
#:use-module (srfi srfi-9)
#:use-module (ice-9 match)
- #:export (make-rmeta-slot
+ #:export (build-rmeta-slot
+ rmeta-slot-table rmeta-slot-cache
maybe-build-rmeta-slot-cache!
class-rmeta-ref))
maybe-build-rmeta-slot-cache!
class-rmeta-ref))
@@
-40,8
+41,8
@@
;;; ;; Define a class with a meta-slot
;;; (define-class <kah-lassy> ()
;;; (entries #:allocation #:each-subclass
;;; ;; Define a class with a meta-slot
;;; (define-class <kah-lassy> ()
;;; (entries #:allocation #:each-subclass
-;;; #:init-
value
-;;; (
make
-rmeta-slot
+;;; #:init-
thunk
+;;; (
build
-rmeta-slot
;;; `((foo . "bar")
;;; (baz . "basil")))))
;;;
;;; `((foo . "bar")
;;; (baz . "basil")))))
;;;
@@
-52,8
+53,8
@@
;;; ;; Define a subclass
;;; (define-class <sub-lassy> (<kah-lassy>)
;;; (entries #:allocation #:each-subclass
;;; ;; Define a subclass
;;; (define-class <sub-lassy> (<kah-lassy>)
;;; (entries #:allocation #:each-subclass
-;;; #:init-
value
-;;; (
make
-rmeta-slot
+;;; #:init-
thunk
+;;; (
build
-rmeta-slot
;;; `((foo . "foo2")
;;; (peanut . "gallery")))))
;;;
;;; `((foo . "foo2")
;;; (peanut . "gallery")))))
;;;
@@
-68,8
+69,9
@@
(table rmeta-slot-table)
(cache rmeta-slot-cache set-rmeta-slot-cache!))
(table rmeta-slot-table)
(cache rmeta-slot-cache set-rmeta-slot-cache!))
-(define (make-rmeta-slot table)
- (%make-rmeta-slot table #f))
+(define (build-rmeta-slot table)
+ (lambda ()
+ (%make-rmeta-slot table #f)))
;; Immutable and unique
(define %the-nothing (cons '*the* '*nothing*))
;; Immutable and unique
(define %the-nothing (cons '*the* '*nothing*))
@@
-101,9
+103,9
@@
(set-rmeta-slot-cache! rmeta-slot (build-cache))))
(define* (class-rmeta-ref class slot-name key
(set-rmeta-slot-cache! rmeta-slot (build-cache))))
(define* (class-rmeta-ref class slot-name key
- #:key (equals? eq?)
- (cache-set! hash
q
-set!)
- (cache-ref hash
q
-ref)
+ #:key (equals? eq
ual
?)
+ (cache-set! hash-set!)
+ (cache-ref hash-ref)
dflt)
"Search heirarchy of CLASS through the rmeta-slot named SLOT-NAME for
value matching KEY. This also calls maybe-build-rmeta-slot-cache! as a side
dflt)
"Search heirarchy of CLASS through the rmeta-slot named SLOT-NAME for
value matching KEY. This also calls maybe-build-rmeta-slot-cache! as a side