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 '())
(tail '())
(this
(object/abstract
(object/immutable-attributes
'push!
(lambda (val)
(set! head (cons val head))

View File

@ -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)
;;; Like OBJECT/ATTRIBUTES, but with SET!, GET, and DELETE! removed.
(define object/immutable-attributes
(lambda args
(let ((obj (apply object/attributes args)))
(obj 'delete! 'set!)
(obj 'delete! 'get)
(obj 'delete! 'delete!)
obj))
;;; Like OBJECT/ATTRIBUTES, but with SET!, GET, and DELETE! removed.
(define object/abstract
(lambda args
(object-make-abstract! (apply object/attributes args))))
obj)))

View File

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