[plt-scheme] Newbie question: picking the right data structure

From: Gregg Williams (spamme at innerpaths.net)
Date: Sat Jul 18 10:03:01 EDT 2009

Hi! I'm fairly new at Scheme, though I have written a number of
programs in the functional style with no problem. However, I'm hitting
a blind spot and would like somebody's opinion.

I want to use Scheme to create an interactive environment for
exploring a data set (i.e., from the command line). Each datum is
represented by a string that I use as a key, so I will be building up
various named lists of strings and adding to them.

Here's my problem: I can't seem to find a good way to add strings to a
list identified by a fixed variable name. I can't seem to use "define"
to overwrite the variable with a new list. I could use a vector, but
that would waste a lot of space if I made all vectors long enough for
practical purposes. I looked into using mutable lists, but
destructively splicing a second list onto the list connected to my
veritable name has repercussions.

Am I missing something obvious, or do I have to just choose one of
these options and deal with the consequences? Thanks for your help.

Posted on the users mailing list.