[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Appending a newline to a string
From: |
John Cowan |
Subject: |
Re: [Chicken-users] Appending a newline to a string |
Date: |
Thu, 21 Oct 2010 11:42:30 -0400 |
2010/10/21 Joe Python <address@hidden>:
> How to append a newline to a string?
> I wish to do that in memory before I start writing to a file.
> The string function seems to stringify the newline control character as
> follows.
>
> ------------< snip >---------------------------
>
> (apply string '(#\a #\b #\newline)) => "ab\n"
>
> ------------< snip >------------------------------
Your code is perfectly correct; it's just that you want to use
`display` rather than `write` to write out the string, so that you get
its characters rather than a Scheme-level representation of the string
object itself.