Revert "object: rename"

This makes things much slower for questionable benefit. A better
version might use a hash table. A better interpreter would use
some form of partial evaluation to optimize the EQ? chain.

This reverts commit 4acea69841.
This commit is contained in:
Peter McGoron 2024-09-27 11:15:35 -04:00
parent 4acea69841
commit 625fdfeb39
3 changed files with 8 additions and 12 deletions

View File

@ -27,7 +27,7 @@
((head '()) ((head '())
(tail '()) (tail '())
(this (this
(object/abstract (object/immutable-attributes
'push! 'push!
(lambda (val) (lambda (val)
(set! head (cons val head)) (set! head (cons val head))

View File

@ -41,7 +41,6 @@
(if (not proc) (if (not proc)
(error 'object 'invalid-op op args) (error 'object 'invalid-op op args)
(apply proc args)))))) (apply proc args))))))
(lambda (op . args) (lambda (op . args)
(let ((proc (table 'get op))) (let ((proc (table 'get op)))
(if (not proc) (if (not proc)
@ -65,14 +64,11 @@
(apply process-args args))))) (apply process-args args)))))
(apply check-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. ;;; Like OBJECT/ATTRIBUTES, but with SET!, GET, and DELETE! removed.
(define object/abstract (define object/immutable-attributes
(lambda args (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)))

View File

@ -77,7 +77,7 @@
(datum-labels '()) (datum-labels '())
(fold-case? #f) (fold-case? #f)
(this (this
(object/abstract (object/immutable-attributes
'process 'process
(lambda (ch) (lambda (ch)
(this 'update-position! ch) (this 'update-position! ch)