This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
string-append/shared
- From: Chris Dean <Chris dot Dean at sokitomi dot com>
- To: Kawa List <kawa at sources dot redhat dot com>
- Date: Fri, 12 Sep 2003 00:33:58 -0700
- Subject: string-append/shared
What's the correct way to write string-append/shared in Kawa?
(The string-append/shared procedure is documented in SRFI-13:
http://srfi.schemers.org/srfi-13/srfi-13.html#string-append/shared
)
Here's one way, but is it acceptable to call the addAll method? or is
that looking inside Kawa internals too much?
(define (string-append/shared str #!rest rest)
(let loop ((acc :: <string> str)
(rest rest))
(if (null? rest)
acc
(let ((s (car rest)))
(invoke acc 'add-all s)
(loop acc (cdr rest))))))
Regards,
Chris Dean