// file: mail2.rex // author: keller // purpose: development of a mailing list processor, step 2 // development of a mailing list processor // select(lists, db) creates selects the mailing lists named in 'lists' // from the database db. select(lists, db) = keep((List) => member(first(List), lists), db); test() = select(["cs-majors", "math-majors", "class of 00"], db); // built-in functions used: first, member, keep // db is the database of mailing lists; It is a list of lists. // Each list consists of the name of the mailing list, followed by // the individuals on the list. db = [ ["cs-majors", "mary", "john", "tom", "avi" ], ["math-majors", "alice", "tom", "franz", "yukio" ], ["class of 99", "mary", "tom", "yukio" ], ["class of 00", "john", "avi", "alice", "franz" ], ["cs-faculty", "george", "gwen", "prithi" ], ["math-faculty", "al", "gwen" ], ["curriculum-comm", "al", "prithi" ] ];