last call for kawa 1.14

Per Bothner per@bothner.com
Fri Sep 27 15:20:00 GMT 2013


On 09/27/2013 05:27 AM, Matthieu Vachon wrote:
> On Fri, Sep 27, 2013 at 3:31 AM, Per Bothner <per@bothner.com> wrote:
>>
>> It's a feature: You can argue whether it's a good idea, and
>> there are certainly cases where things get more complicated,
>> but at least for now the feature stays.
>>
>
> I understand and it's ok with me. Our use case was to print digits one
> at a time to a file. We were printing integers so it was resulting in
> spaces in the number representation. We are now ensuring to display
> string instead so there is no spaces between digits in the file.

You can display characters instead of strings - they're displayed
without extra spaces, as in write-char:

(for-each (lambda (i) (display (integer->char (+ 48 i)))) '(6 5 4))
or:
(for-each (lambda (i) (display (string-ref "0123456789" i))) '(6 5 4))

Using write-char is still more efficient:

(for-each (lambda (i) (write-char (string-ref "0123456789" i))) '(6 5 4))
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Kawa mailing list