Searching elements in an association list...
Posted: Thu Dec 01, 2005 12:16 am
I would like to know if there is a function in NewLISP that will return all the elements of an association list based on the value of any of the lists members.
For example, I have the following list:
("fruit" "bannana" "pear" "apple" "plum" "grapes")
("vegatables" "lettuce" "celery" "cucumbers" "olives" "onions")
("junk food" "ice cream" "licorice" "chocolate bar" "carmel apple" "bubble gum")
I want to be able to retrieve the entire "junkfood" list by searching for any one of the elements. I believe the lookup and assoc functions only allow you to do this when using the first element in the association list.
Thanks for the help.
The Sunburned Surveyor
For example, I have the following list:
("fruit" "bannana" "pear" "apple" "plum" "grapes")
("vegatables" "lettuce" "celery" "cucumbers" "olives" "onions")
("junk food" "ice cream" "licorice" "chocolate bar" "carmel apple" "bubble gum")
I want to be able to retrieve the entire "junkfood" list by searching for any one of the elements. I believe the lookup and assoc functions only allow you to do this when using the first element in the association list.
Thanks for the help.
The Sunburned Surveyor