Generalized Distance and Discrete Variables