Re: no char->string / string-append



In article <slrndtkkud.1pc.leadvoice@xxxxxxxxxxxxxxxxxx>,
Neil Cerutti <leadvoice@xxxxxxxxx> wrote:
> Do I have to use make-string to append chars onto the end of
> strings? A la
>
> (string-append "Hello" (make-string 1 #\!))

Well, (string-append "Hello" (string #\!)) is marginally simpler. I'm
assuming that #\! here really indicates a non-constant character.

> I suppose the real solution would be to not use string-append at
> all. Any advice?

Appending strings is slow. Use string ports (srfi-6) if you have them.


Lauri
.



Relevant Pages

  • Re: no char->string / string-append
    ... >> Do I have to use make-string to append chars onto the end of ... > Appending strings is slow. ... up into more digestible functions. ... (define (power n) ...
    (comp.lang.scheme)
  • no char->string / string-append
    ... Do I have to use make-string to append chars onto the end of ... I suppose the real solution would be to not use string-append at ...
    (comp.lang.scheme)