mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
* goops.scm (compute-getters-n-setters): Check for bad init-thunk.
This commit is contained in:
parent
57b1d51841
commit
266f3a23d7
2 changed files with 13 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
2003-04-17 Mikael Djurfeldt <djurfeldt@nada.kth.se>
|
||||
|
||||
* goops.scm (compute-getters-n-setters): Check for bad init-thunk.
|
||||
|
||||
2003-04-15 Mikael Djurfeldt <djurfeldt@nada.kth.se>
|
||||
|
||||
* goops.scm (compute-getter-method): For custom getter: Check
|
||||
|
|
|
@ -1192,8 +1192,14 @@
|
|||
;;;
|
||||
(define (compute-getters-n-setters class slots env)
|
||||
|
||||
(define (compute-slot-init-function s)
|
||||
(or (slot-definition-init-thunk s)
|
||||
(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))
|
||||
(let ((init (slot-definition-init-value s)))
|
||||
(and (not (unbound? init))
|
||||
(lambda () init)))))
|
||||
|
@ -1233,7 +1239,7 @@
|
|||
;; '() for other slots
|
||||
(verify-accessors name g-n-s)
|
||||
(cons name
|
||||
(cons (compute-slot-init-function s)
|
||||
(cons (compute-slot-init-function name s)
|
||||
(if (or (integer? g-n-s)
|
||||
(zero? size))
|
||||
g-n-s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue