# returns true if ref is a valid reference and its type is 'map'
function(map_isvalid  ref )
	ref_isvalid("${ref}")
	ans(isref)
	if(NOT isref)
		return(false)
	endif()
	ref_gettype("${ref}")
  ans(type)
	if(NOT "${type}" STREQUAL "map")
		return(false)
	endif()
	return(true)
endfunction()