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 '())
|
((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))
|
||||||
|
|
16
object.scm
16
object.scm
|
@ -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)))
|
||||||
|
|
Loading…
Reference in New Issue