[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newline in string literal?



Matthew Flatt <mflatt@cs.utah.edu> writes:
>Eli also changed `write' (but not `display') to use C escapes in
>printing strings, using octal for non-printable characters:
>  > "\011\377\n"
>  "\t\377\n"
>I like this change to `write', but if anyone anticiapates a problem
>with it, let me know; I can add a parameter that turns it off.

What's a non-printable character? If this includes only ASCII codes
32-127 (as isprint(3) in C does), I think it would be a good thing to
have a provision for other printable characters (e.g., ISO Latin-1
on Unix), so that the interpreter would continue to respond like:
> "pääsky"    
"pääsky"
and not:
> "pääsky"
"p\344\344sky"

Otherwise, I can't think of a problem, except perhaps compatibility:
older versions of MzScheme can't read strings written by the new
version. (But it should work the other way around, so this might not
be a problem - though it would be good to say this in the
documentation.)

-- 
-=- Rjs -=- rjs@lloke.dna.fi