module Parsing ( parseVar ) where import Char -- Steele's code uses a "pvar" function in figures 12 and 14 to parse -- variable names. He calls pvar from "plambda" in figures 12 and 14, -- as well as "pcatch" in figure 15. The types of these calls are -- unsound. For example, "pcatch" in figure 15 assumes that there is -- such a thing as a Var term in the term type; no way to type the -- "continuation" function can guarantee so. -- We implement here a simple "parseVar" function that parses variable -- names. Our reimplementation of figures 12, 14 and 15 (namely the -- modules CBV, CBN and Cont) use parseVar. parseVar s = case span isLower s of ([],_) -> [ ] x -> [x]