fix printing error location
impl to_string
debug print
define 'space' pattern
formal arguments accept pattern