Nicolas Neuss <[EMAIL PROTECTED]> writes:

> P.S.: Somehow the philosophy behind the structure slot-accessors is
> wrong (or better, quite low-level, a replacement for not having type
> declarations everywhere).  If I write struct1-dimension everywhere in
> my program I cannot easily exchange struct1 against struct2.  On the
> other hand, I can do that with generic functions.  Unfortunately,
> generic functions are slow, therefore I want to transform them away
> when declaring the type of an argument at the beginning of some
> function.

The reason g-fs are slow is exactly what you explain here. Because
struct accessors know exactly where the slot is in the data structure,
they can get it quickly. g-fs must dispatch to the proper slot-value
accessor for the class of the object passed in. That's about as
optimized as you can get unless you declare that the class is sealed;
in which case, you might as well use structs.

-- 
-> -/                        - Rahul Jain -                        \- <-
-> -\  http://linux.rice.edu/~rahul -=-  mailto:[EMAIL PROTECTED]   /- <-
-> -X "Structure is nothing if it is all you got. Skeletons spook  X- <-
-> -/  people if [they] try to walk around on their own. I really  \- <-
-> -\  wonder why XML does not." -- Erik Naggum, comp.lang.lisp    /- <-
|--|--------|--------------|----|-------------|------|---------|-----|-|
   (c)1996-2002, All rights reserved. Disclaimer available upon request.

Reply via email to