At 10:06 AM 1/31/2001 -0200, Branden wrote:
>Matthew Cline wrote:
> > Should there be method to tell an SV to change the internal representation
>of
> > the data? For example, if an SV was created as a string, but is being
>turned
> > into a float over and over again for use in equations, it would save
> > processing time to convert the internal representation to a float. Or
>would
> > the SV take care of stuff like that transparently?
> >
>At least now, in perl5, a SV keeps cached copies of its values in all
>formats (int, float, char*) once translated. When the value is changed, it
>invalidates other formats and calculates them and caches them the first
>time they're needed. Actually, I guess this will be handled directly by
>the vtable. If it's supposed to cache the formats, it will provide the
>methods for doing it. If it's supposed to return a different value every
>time (like tied variables can do), it will probably not want a cache.
Caching of values will be handled internally depending on how the datatype
thinks it should do it. The core won't assume caching on this level, and
count on the variable vtables to Do The Right Thing.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk