TYPECASE ref OF | NULL => IO.Put("Null\n"); | CHAR => IO.Put("Char\n"); | INTEGER => IO.Put("Integer\n"); ELSE IO.Put("Something\n"); END;