diff options
Diffstat (limited to 'oop/goops.scm')
-rw-r--r-- | oop/goops.scm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/oop/goops.scm b/oop/goops.scm index 2d53cb94a..ebeac4c6f 100644 --- a/oop/goops.scm +++ b/oop/goops.scm @@ -1190,17 +1190,20 @@ (define standard-set (standard-accessor-method make-set standard-set-methods)) ;;; compute-getters-n-setters -;;; +;;; +(define (make-thunk thunk) + (lambda () (thunk))) + (define (compute-getters-n-setters class slots env) (define (compute-slot-init-function name s) (or (let ((thunk (slot-definition-init-thunk s))) (and thunk - (if (not (and (closure? thunk) - (thunk? thunk))) - (goops-error "Bad init-thunk for slot `~S' in ~S: ~S" - name class thunk)) - thunk)) + (cond ((not (thunk? thunk)) + (goops-error "Bad init-thunk for slot `~S' in ~S: ~S" + name class thunk)) + ((closure? thunk) thunk) + (else (make-thunk thunk))))) (let ((init (slot-definition-init-value s))) (and (not (unbound? init)) (lambda () init))))) |