[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird result on using define-class twice
From: |
Thien-Thi Nguyen |
Subject: |
Re: Weird result on using define-class twice |
Date: |
Wed, 06 Feb 2002 14:36:58 -0800 |
From: Thomas Wawrzinek <address@hidden>
Date: Tue, 4 Dec 2001 09:55:43 +0100 (MET)
;;; OK, this is very *wrong*!
(define-class <bar> (<root>))
actually, there are no <bar> objects at this point, so redefining the
class is no big deal. however...
(define baz (make <bar> #:b-value "BAZ"))
i would think if an error is to be signalled, it would be here, in the
form of a "no such accessor" error.
I expected that because of the second (define-class <bar> ...) I
would get some sensible error message (at least about the usage of
(a-value ...) in the (print ...) generic function call).
Maybe I'm mistaken here, I know that GOOPS has a class redefinition
protocol, but does it go with the define-class macro?
`define-class' does a class redefinition if not `(defined? name env)'.
I accidently had such a second (define-class ...) with an already
used class-name. In a much more complex program than the above, this
resulted in a segmentation fault (backtrace told me it was GC
related).
ok, i'll stay away from that for now, and will add the simpler case
described above to BUGS.
To avoid such behavior, would it be sensible to have guile indicate
a wrong usage error or something?
would it be correct to surmise that such a case can be detected
statically? if so, probably we need to write "guile-tools lint".
thi
- Re: Weird result on using define-class twice,
Thien-Thi Nguyen <=