guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Growable arrays?


From: David Kastrup
Subject: Re: Growable arrays?
Date: Mon, 11 Jun 2012 14:28:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Noah Lavine <address@hidden> writes:

>>> vlist is a data type introduced around guile 2.0.  You will find it
>>> documented in the Guile Reference under Compound Data Types.
>>>
>>> They are growable and provide vector-like access performances and
>>> memory locality.
>>
>> Ah, too bad.  This needs to run under 1.8 as well.
>
> If you need to support older versions of Guile, then you can't use any
> data structures we add now anyway, correct? So it seems like you will
> have to implement growable vectors yourself no matter what.
>
> If you want to, though, you could look at the implementation of vlists
> in Guile 2.0, which I think is all in Scheme. See
> module/ice-9/vlist.scm.
>
> Even if we can't fix it, it is still nice to hear about data
> structures you wish Guile had, so that in a few more versions this
> might not be a problem for you.

I don't think I need yet another data structure deficient in some
respects.  We have vectors that can't grow, hashtables that can grow but
only index through a hash function, vlists that can grow but have
immutable content...

Where is the point in thinking up yet another restriction that will make
for a new data structure "complementing" the others?

Why not just have a superset without arbitrary restriction and implement
the other structures based on that?  Then each one just needs to enforce
its personal restrictions in its accessor functions, and otherwise just
use what is there in the general mechanism.

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]