mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-07 18:30:25 +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:
parent
8befde009a
commit
ac0e91c42d
1 changed files with 8 additions and 3 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue