Associative Lists

new topic     » topic index » view thread      » older message » newer message

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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu