princ-to-string to implement ~a and ~S format directives