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:
parent
4acea69841
commit
625fdfeb39
|
@ -27,7 +27,7 @@
|
|||
((head '())
|
||||
(tail '())
|
||||
(this
|
||||
(object/abstract
|
||||
(object/immutable-attributes
|
||||
'push!
|
||||
(lambda (val)
|
||||
(set! head (cons val head))
|
||||
|
|
16
object.scm
16
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)))
|
||||
|
|
Loading…
Reference in New Issue