This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]