[movitz-devel] Re: adjust-array and basic-vector
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Fri Jun 3 05:36:41 UTC 2005
Shawn Betts <sabetts at vcn.bc.ca> writes:
> I noticed that adjust-array isn't implemented (and hash
> resizing). The basic-vector binary-type has a section called
> data. The comment suggests the data is stored right there..as
> opposed to pointing to where the data is stored. Is this so?
Yes.
> If so, won't this be problematic for resizing the vector?
That's right, such a vector cannot be adjustable. But this isn't
really a problem with the basic-vector layout as such, rather the
point is that there needs to be (at least) one other data-structure
that implements adjustable (and/or displaced, multi-dimensional)
arrays.
This could I suppose be done simply by building on the existing stuff,
e.g. by using defstruct etc on the losp/.. side of things. A number of
functions in array.lisp would have to be modified, and also several
things in typep.lisp, to integrate it properly with the type-system.
Hash resizing can be implemented independently of this, since the
hash-table object already gives you an indirect link to the vector
data. (And BTW note that EQ hash-tables aren't GC-safe yet,
either... for keys other than immediates and symbols, that is.)
--
Frode Vatvedt Fjeld
More information about the movitz-devel
mailing list