1. Associative Lists
- Posted by Larry Gregg <lgregg at BIG12.METROBBS.COM>
Apr 03, 1997
-
Last edited Apr 04, 1997
Mr Jeff Zeitlin (jeff.zeitlin at execnet.com) writes about:
> -- assoc.e - associative lists
Some implementations of Snobol4 provide built in functions to
sort tables. For example, sort(table,i) will sort in
ascending fashion, and rsort(table,i) will do a descending
sort. The "i" parameter has the value of 1 when you wish to
sort by key, and 2 for a value sort. I think that some of
these implementations convert the table to an N row by 2
column array, or sequence in Euphoria.
You might consider adding this functionality.
Anyway, as an example of usage of associative lists for list
members who have never used them, you can count the number of
occurrences of distinct words in a text file, storing each
word in the key and the count in the value. With a sort
feature, you could then sort it and print it out. Good stuff.
Larry Gregg
lgregg at big12.metrobbs.com