Hi,
David writes about oldarray:
>I thought I'd mention my contribution to this, since it took a lot of
>thought to get it right, but I believe I did get it right in the end.
<snip>
>http://www.cs.bham.ac.uk/research/poplog/popvision/lib/oldarray.p
>http://www.cs.bham.ac.uk/research/poplog/popvision/help/oldarray
That is very clever - a reallocator that cooperates with the GC.
But this might be a stupid idea but I'll suggest it anyway. Why not
invent a special tag type like this?
;;; Choose a better name ... this name chosen to match the
;;; documentation.
defclass OldArrayTag {};
procedure( bounds, tag );
oldanyarray( tag, bounds, vector_key )
endprocedure -> class_apply( OldArrayTag_key );
And you get this idiom:
lconstant oldarray1 = newOldArrayTag();
...
lvars array = oldarray1( bounds );
I think it is a more elegant way to package up the tag. The tag now represents
a reallocator which is quite a nice idea. You've lost nothing because you
can still write
oldanyarray( oldarray1, bounds, key ) -> array
for the full generality. But maybe I am just missing the whole point ..... ?
--
Steve
|