[plt-scheme] problem with \"

From: Alexandre Hubert (alexandrehub at hotmail.com)
Date: Tue Dec 13 10:10:33 EST 2005


Here is my problem : I have a list, for instance (x y \"z\") , in which the 
double-quotes are preceded by a backslash, and I want to format it to obtain 
the list (x y "z") (e.g. without the backslashes). The only way I found to 
do it is to write the list into an external file with fprintf "~a", then 
read the file to get the list without the backslashes, and I would like to 
do it without having to write in an external file. I tried format "~a", I 
tried display and fprintf "~a" into a open-output-string, and none of these 
worked, the backslashes remain (and I am surprised by the behavior of 
fprintf "~a", as if the port is open on an external file, the backslashes 
are removed, while if it is open on a string, they are not. Shouldn't 
fprintf write the same thing whatever the port is open on ?)

Thank you for your help.

Posted on the users mailing list.