define switch function r-expression as do scan #current-input match "+" term r-expression match "-" term r-expression done ;if not matched above, accept the empty string return true