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

write-to-string



                      write-to-string
Is there any difference between the result of (write-to-string X) and (format
nil "~s" X)?

I deal with strings with quotes (i.e.,(write-to-string  '(strings "string #005#"
"etc" ))). 
These strings passed to C and back to LISP.   

I made my application to an independent application using BinHex.lisp in the
example folder.
To my surprise, (write-to-string  '(strings "string #005#" "etc" )) in the
independent application 
produces "(strings string #005# etc )".  The inside quotes are stripped.  I expect
it to  be
"(strings \"string #005#\" \"etc\")" .

This happens ONLY when running an independent application.  I guess BinHex did
something to the result of write-to-string.  After I changed write-to-string to
format , this problem goes away.   Make me wonder the differences between the
two.  

Sheldon Shen