Back door to 'slot-value-using-class? 
Author Message
 Back door to 'slot-value-using-class?

I am developing a metaclass which I want to make as clean as and
efficient as possible, and I think that means specializing
'slot-value-using-class (SVUC) on my metaclass to extend the standard
behavior.

But my internals themselves need to read and write slots themselves in a
fashion bypassing the extra processing, and this is not just a matter of
invoking 'call-next-method.

I have a version which creates readers and writers which all call
'my-slot-value, at which point SVUC itself becomes the "backdoor"
access, and that is the one I will soldier on with since the project
(something new) is under time pressure, but I do not like ti for a
couple of reasons and it would be great if i could work around this.

One thing that worked was:

(defun backdoor-slot-value (self esd)
  (slot-value-using-class (find-class 'standard-class)
                           self
                           esd)))

...but when I attempted to do that with another metaclass (ACL's
persistent AllegroStore metaclass) I broke something. I have a Q into
their tech support, but I get the feeling this type of fast-and-loose
might not be something I can expect to be supported.

Of course, I could always set a global....but that scares me...what
happens when we get into multiple threads? I could add a slot to each
instance, but pretty soon I take a performance hit on all slot access.

Well, does anyone know of back door I can use to bypass my own SVUC
specializations?

thx

kenny tilton
clinisys



Fri, 08 Mar 2002 03:00:00 GMT  
 Back door to 'slot-value-using-class?
One option is to call clos::slot-value--si directly to bypass
the slot access protocol.

Gary.
--

|> I am developing a metaclass which I want to make as clean as and
|> efficient as possible, and I think that means specializing
|> 'slot-value-using-class (SVUC) on my metaclass to extend the standard
|> behavior.
|>
|> But my internals themselves need to read and write slots themselves in a
|> fashion bypassing the extra processing, and this is not just a matter of
|> invoking 'call-next-method.
|>
|> I have a version which creates readers and writers which all call
|> 'my-slot-value, at which point SVUC itself becomes the "backdoor"
|> access, and that is the one I will soldier on with since the project
|> (something new) is under time pressure, but I do not like ti for a
|> couple of reasons and it would be great if i could work around this.
|>
|> One thing that worked was:
|>
|> (defun backdoor-slot-value (self esd)
|>   (slot-value-using-class (find-class 'standard-class)
|>                            self
|>                            esd)))
|>
|>
|> ...but when I attempted to do that with another metaclass (ACL's
|> persistent AllegroStore metaclass) I broke something. I have a Q into
|> their tech support, but I get the feeling this type of fast-and-loose
|> might not be something I can expect to be supported.
|>
|> Of course, I could always set a global....but that scares me...what
|> happens when we get into multiple threads? I could add a slot to each
|> instance, but pretty soon I take a performance hit on all slot access.
|>
|> Well, does anyone know of back door I can use to bypass my own SVUC
|> specializations?
|>
|> thx
|>
|> kenny tilton
|> clinisys



Sun, 10 Mar 2002 03:00:00 GMT  
 Back door to 'slot-value-using-class?

Quote:

> One option is to call clos::slot-value--si directly to bypass
> the slot access protocol.

> Gary.

Thx, can't believe how many times I apropos'ed slot-value without
spotting that..not that that name jumps right out at you.

But I realize now I was nuts to ask for such a thing, especially since I
am sitting on top of a persistent metaclass..something tells me that is
one protocol i do not want to bypass. :)

I also discovered explicit MOP doc suggesting my little trick...

Quote:
> |>
> |> (defun backdoor-slot-value (self esd)
> |>   (slot-value-using-class (find-class 'standard-class)
> |>                            self
> |>                            esd)))
> |>

would produce undefined results. And, by the by, I think that should
have been (find-class 'standard-object).

I decided to set a global and get on with my life. :) Thx for the input.

kenny
clinisys



Sun, 10 Mar 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dylan Tip #101: don't use keyword init-values with class allocated slots

2. :ALLOCATION :CLASS: getting slot value

3. I want 'Class'Input back!

4. Access to a class's slot-names

5. Back Door Account in Interbase

6. What Back Door is this!!

7. Trojan Back-Door-G2.svr.gen

8. when we using 'back-slash'

9. Using cPickle, pickle or marshal to preserve attribute values of a class instance

10. How can I slide open a door without using the animator in Cosmoworlds

11. Limiting accepted values in slots

12. Objects with Lazy Evaluation Slot Values

 

 
Powered by phpBB® Forum Software