Le dimanche 22 novembre 2020 à 21:24 +0100, Zelphir Kaltstahl a écrit :
> If I had a vector, I could simply go by index backwards or
> forwards without adding any runtime complexity.

So, you would like to sometimes go forward, sometimes go backward? If
it is sequential, the list is what you want. With the 2-variable
function used earlier, you can go in one direction or the other,
depending on which argument you decompose.

> a more specific
> but less generally useful question is: "What do I use in Guile, if I
> were using a dynamic array in Python?"

It depends. If you were using a dynamic array in Python because there
was no good implementation of what guile calls lists or vectors, use
lists or vectors ;-)

If you were using a dynamic array because you wanted to grow lists
while keeping random indexing, use VLists (
https://www.gnu.org/software/guile/manual/guile.html#VLists). Or hash
tables (https://www.gnu.org/software/guile/manual/guile.html#VHashes, 
https://www.gnu.org/software/guile/manual/guile.html#Hash-Tables).


Reply via email to