/* --- Copyright University of Sussex 1995. All rights reserved. ----------
 > File:			C.all/lib/database/database_which.p
 > Purpose:			Get values of variables
 > Author:			John Gibson, Dec 27 1995
 > Documentation:	REF * DATABASE
 > Related Files:
 */
compile_mode :pop11 +strict;

section;

define database_which(Vars, Pattern) -> List;
	lvars Vars, Pattern, List;
	if islist(Vars) or isident(Vars) or isword(Vars) then
		if islist(Pattern) then
			[%	forevery Pattern do
					if islist(Vars) then
						maplist(Vars, valof)
					else
						valof(Vars)
					endif
				endforevery
			%] -> List
		else
			mishap(Pattern, 1, 'database_which: LIST NEEDED')
		endif;
	else
		mishap(Vars, 1, 'database_which: WORD, IDENTIFIER OR LIST NEEDED')
	endif;
enddefine;

endsection;
