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.
- Branden