diff options
| author | 2024-09-26 21:52:51 -0400 | |
|---|---|---|
| committer | 2024-09-26 21:52:51 -0400 | |
| commit | 4acea69841ad62ec5d46eb565bbb5d98f84b3d38 (patch) | |
| tree | fdc8b8a096c5dfbed8a29db006fe9a8106a5656a | |
| parent | object: change to a stateful table (diff) | |
object: rename
| -rw-r--r-- | linked-list.scm | 2 | ||||
| -rw-r--r-- | object.scm | 16 | ||||
| -rw-r--r-- | read.scm | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/linked-list.scm b/linked-list.scm index 67e32ab..814f83f 100644 --- a/linked-list.scm +++ b/linked-list.scm @@ -27,7 +27,7 @@ ((head '()) (tail '()) (this - (object/immutable-attributes + (object/abstract 'push! (lambda (val) (set! head (cons val head)) @@ -41,6 +41,7 @@ (if (not proc) (error 'object 'invalid-op op args) (apply proc args)))))) + (lambda (op . args) (let ((proc (table 'get op))) (if (not proc) @@ -64,11 +65,14 @@ (apply process-args args))))) (apply check-args args))))) +(define object-make-abstract! + (lambda (obj) + (obj 'delete! 'set!) + (obj 'delete! 'get) + (obj 'delete! 'delete!) + obj)) + ;;; Like OBJECT/ATTRIBUTES, but with SET!, GET, and DELETE! removed. -(define object/immutable-attributes +(define object/abstract (lambda args - (let ((obj (apply object/attributes args))) - (obj 'delete! 'set!) - (obj 'delete! 'get) - (obj 'delete! 'delete!) - obj))) + (object-make-abstract! (apply object/attributes args)))) @@ -77,7 +77,7 @@ (datum-labels '()) (fold-case? #f) (this - (object/immutable-attributes + (object/abstract 'process (lambda (ch) (this 'update-position! ch) |
