guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GOOPS:Can I just overload "slot-set!" under #:virtual and let alone


From: Nala Ginrut
Subject: Re: GOOPS:Can I just overload "slot-set!" under #:virtual and let alone "slot-ref" ?
Date: Fri, 3 Dec 2010 08:52:37 +0800

thanks, but my question is something like this:
...
(cache ... #:slot-ref (lambda (o) (slot-ref o 'cache)) ...) ;; ERROR
...
(sunday ... #:slot-ref (lambda (o) (slot-ref o 'cache)) ...) ;; That's OK

I could call "(slot-ref o 'cache)" in other slot except "cache", but what should I do if I need to use "(slot-ref o 'cache)" in the "cache" definition?
I used it directly and got "stack overflow". I think it may cause infinite recursive.
Actually my question can be described more explicitly: "Can I just re-define "slot-ref" or "slot-set!" any one of them but NOT both?"
Sometimes I may need a re-defined "slot-set!" but I expect to let alone "slot-ref".
Anybody catch my mind?
reply via email to

[Prev in Thread] Current Thread [Next in Thread]