val gensym = let val count = ref 0 in fn () => (count := !count +1; "X"^(Int.toString (!count))) end