A NEW LOOK AT COMPACTNESS VIA DISTANCES TO FUNCTION SPACES