Always better with an example:<br><br>> (with-input-from-string<br> (with-output-to-string (ë() (write 'x) (write 'y)))<br> (ë() (list (read) (read) (read))))<br>'(xy #<eof> #<eof>)<br>> (with-input-from-string<br>
(with-output-to-string (ë() (write 'x) (write " ") (write 'y)))<br> (ë() (list (read) (read) (read))))<br>'(x " " y)<br>> (with-input-from-string<br> (with-output-to-string (ë() (write 'x) (display " ") (write 'y)))<br>
(ë() (list (read) (read) (read))))<br>'(x y #<eof>)<br><br>Laurent<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 5, 2012 at 9:41 AM, Laurent <span dir="ltr"><<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Fri, Nov 2, 2012 at 7:48 PM, Laurent <span dir="ltr"><<a href="mailto:laurent.orseau@gmail.com" target="_blank">laurent.orseau@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <div class="gmail_extra"><div class="gmail_quote"><div><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
</div>You're using just `write', so you need some whitespace between items:<br>
<br>
> (with-input-from-string<br>
(with-output-to-string (ë() (write 'x) (write 'y)))<br>
read)<br>
'xy<br></blockquote></div><div><br></div></div></div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div class="gmail_quote">
<div><br>Wow, thanks a lot, I would have never thought about that. I thought that 'write' was sending data, not mere characters.<br>Writing a space after each output indeed solves the problem.<br></div></div></div>
</blockquote><br></div></div></div>For reference, one needs to use (printf " ") or (display " ") but not (write " ") or (print " "), because, IIUC, 'write' does send data, but does not add delimiters to the data if there are none yet.<br>
I.e., a string like " " is self-delimited, a list (a b c) is also self-delimited, but symbols and numbers are not. This means that the delimiter must be added by hand.<br>'display' sends a space to the stream, whereas 'write' sends a self-delimited data string " ".<span class="HOEnZb"><font color="#888888"><br>
<br>Laurent<br><br></font></span></div>
</blockquote></div><br></div>