This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: goops: slot option inheritance question
- To: sen_ml at eccosys dot com
- Subject: Re: goops: slot option inheritance question
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 09 May 2000 23:50:10 +0200
- Cc: guile at sourceware dot cygnus dot com
- Cc: djurfeldt at nada dot kth dot se
- References: <20000509184016D.1001@eccosys.com>
sen_ml@eccosys.com writes:
> is there anyway to get slot options to be inherited? i'd like to
> specify some slot options in parent classes and then override and/or
> add slot options in inherited classes.
I'd like slot options to be inherited, but we need to think carefully
how this should be achieved. We should probably do something similar
to what is done in the CLOS MOP.
Until then, you could let the `initialize' method parse your initargs
for options:
(define-class <being> ()
(str)
...)
(define-method (initialize (being <being>) initargs)
(let ((str-val (get-keyword #:str initargs #f)))
(if str-val
(set! (str being) str-val))))
(define-class <human> (<being>)
(str #:accessor str #:init-value 12)
(mag #:init-value 12)
(dex #:init-value 12)
(vit #:init-value 12))