Sergey Skvortsov wrote:

I need store an IV for some AV (for example - the cached value of extra-special computing on all array's elements) and don't want create overcomplicated structure for this simple goal (ex. use ref-to-ref-to-AV with overloading "@{}" or even using attributes).

Ok, I suppose that for existing perl (until 5.10) using pointed fields is safe.

If by that you mean using the IV slot in an AV as private storage, as I stated, that is not [necessarily] a safe assumption. It might work, but then again it might not. I believe that I tried something like that for version objects and the IV slot was not preserved by all operations, but I tried a lot of things, so I may just be misremembering.


Why can't you use an object? You could bless an AV and store your computed values before your actual AV values, i.e. your array starts at index 1 and your computed value is stored at index 0. For that matter you don't even _need_ the overhead of objects if you simply define your API in that way. TMTOWTDI...

John

--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748

Reply via email to