unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: divoplade <d@divoplade.fr>
To: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>,
	Guile User <guile-user@gnu.org>
Subject: Re: Question about data structures
Date: Sun, 22 Nov 2020 22:00:33 +0100	[thread overview]
Message-ID: <1308d70fcfbff31d9e8a655aa809016f15936419.camel@divoplade.fr> (raw)
In-Reply-To: <df2ed155-3477-986a-a6ae-dc2648fd56c4@posteo.de>

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	other threads:[~2020-11-22 21:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-22 18:48 Question about data structures Zelphir Kaltstahl
2020-11-22 19:45 ` divoplade
2020-11-22 20:24   ` Zelphir Kaltstahl
2020-11-22 21:00     ` divoplade [this message]
2020-11-28  2:47       ` Zelphir Kaltstahl
2020-11-22 20:58   ` kwright
2020-11-22 22:50 ` Tim Van den Langenbergh
2020-11-23  3:42 ` Taylan Kammer
2020-11-23  4:42   ` John Cowan
2020-11-23 14:54   ` [EXT] " Thompson, David
2020-11-23  9:52 ` Neil Jerram
2020-11-23 12:24 ` Dr. Arne Babenhauserheide

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1308d70fcfbff31d9e8a655aa809016f15936419.camel@divoplade.fr \
    --to=d@divoplade.fr \
    --cc=guile-user@gnu.org \
    --cc=zelphirkaltstahl@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).