The logical basis of evaluation order and pattern-matching