1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-06 23:50:18 +02:00

(oop goops) works again, after (the-environment) removal

* oop/goops.scm: Update so as not to use (the-environment), which no
  longer exists. I think that the speed characteristics are the same,
  broadly speaking.
This commit is contained in:
Andy Wingo 2008-09-30 20:29:35 +02:00
parent 8befde009a
commit ac0e91c42d

View file

@ -79,6 +79,8 @@
:replace (<class> <operator-class> <entity-class> <entity>)
:no-backtrace)
(define *goops-module* (current-module))
;; First initialize the builtin part of GOOPS
(%init-goops-builtins)
@ -1173,14 +1175,17 @@
(vector-set! methods index m)
m)))))
;; eval tricks are apparently to make the accessors as fast as possible
;; for the evaluator. when goops gets vm-aware, this will be different.
(define (make-bound-check-get index)
(local-eval `(lambda (o) (@assert-bound-ref o ,index)) (the-environment)))
(eval `(lambda (o) (@assert-bound-ref o ,index)) *goops-module*))
(define (make-get index)
(local-eval `(lambda (o) (@slot-ref o ,index)) (the-environment)))
(eval `(lambda (o) (@slot-ref o ,index)) *goops-module*))
(define (make-set index)
(local-eval `(lambda (o v) (@slot-set! o ,index v)) (the-environment)))
(eval `(lambda (o v) (@slot-set! o ,index v)) *goops-module*))
(define bound-check-get
(standard-accessor-method make-bound-check-get bound-check-get-methods))