Re: Nested lists in MetaCard?

Steve Pothier (starnet!apple!aries.saic.com!pothiers)
Wed, 8 Jun 94 07:27:33 MST

>Does anyone have any good ideas on how to build (arbitrarily) nested
>lists in MC?
>
>I have a data file that contains a tree of data. I want to put each
>element at the same level of the tree into a seperate card of the same
>stack. Every time I get a new level, I want a new stack. Then I will
>link cards (nodes of the tree) to the stacks that contain the
>sub-elements.
>
I'm not really sure what you're asking. Are you answering your own
question here, and asking for other possible solutions?

Partially so. :-) I do seem to have that habit.

Are you talking
about creating a list that would be used to maintain the links between the
cards?

I want to add some stack scripts that will read a data file (say, from
standard input) and allow me to brows the data file. Yes, I want
think I need to use some sort of lists in MC to "mmaintain the links"
between cards.

Perhaps a hypothetical example would help. Imagine that I have a
data file that contains geographical data about the US. It might
contain a "tree" of data as in:
Alabama
Arizona
Senators: XX,YY,ZZ
Population: 99999
Counties:
Pima County
Tucson
Area: xxx
Population: xxx
Siera Vist
... (other cities)
Pinal County
... (other counties)
... (other states)
Wyoming

For this example I might have 3 stacks for: states, counties, and
cities. Each stack contains a homogenous group of cards relating to a
single level of the tree (eg. the Cities stack contains only cards
with city information, but from anywhere in the US).

When the user looks at a card in the state stack, she would see
specific, state related fields filled in (eg. "Senators",
"Population", "Counties"). Some of those fields would contain links.
So, if she clicked on a county in the COUNTY field, MC would go to a
specific card in the COUNTY stack. There would be a similar link in a
county card that links to all cities for that county.

Now that I have spelled this out a bit more, there are some more
things that pop to mind. First, I would like to not have to create
all the cards on creation time (I don't won't to create all the
COUNTY cards for the state of Arizona unless the user clicks on the
County field of Arizona). Seconds, it might be reasonable to maintain
auxiliary "dictionaries" so that a click on ANY chunk in any field
would result in a dictionary lookup. The dictionary entry would
contain the stack/card adr of the destination (the other end of the
link).

-sp-