diff --git a/linked-list.scm b/linked-list.scm index 814f83f..67e32ab 100644 --- a/linked-list.scm +++ b/linked-list.scm @@ -27,7 +27,7 @@ ((head '()) (tail '()) (this - (object/abstract + (object/immutable-attributes 'push! (lambda (val) (set! head (cons val head)) diff --git a/object.scm b/object.scm index 6728661..d30574d 100644 --- a/object.scm +++ b/object.scm @@ -41,7 +41,6 @@ (if (not proc) (error 'object 'invalid-op op args) (apply proc args)))))) - (lambda (op . args) (let ((proc (table 'get op))) (if (not proc) @@ -65,14 +64,11 @@ (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/abstract +(define object/immutable-attributes (lambda args - (object-make-abstract! (apply object/attributes args)))) + (let ((obj (apply object/attributes args))) + (obj 'delete! 'set!) + (obj 'delete! 'get) + (obj 'delete! 'delete!) + obj))) diff --git a/read.scm b/read.scm index e1e3243..75d22e0 100644 --- a/read.scm +++ b/read.scm @@ -77,7 +77,7 @@ (datum-labels '()) (fold-case? #f) (this - (object/abstract + (object/immutable-attributes 'process (lambda (ch) (this 'update-position! ch)