diff --git a/docs/api/scheme/cyclone/cgen.md b/docs/api/scheme/cyclone/cgen.md index f0276380..8a34f4b8 100644 --- a/docs/api/scheme/cyclone/cgen.md +++ b/docs/api/scheme/cyclone/cgen.md @@ -8,7 +8,6 @@ The `(scheme cyclone cgen)` library compiles scheme code to a Cheney-on-the-MTA - [`emits`](#emits) - [`emits*`](#emits-1) - [`emit-newline`](#emit-newline) -- [`string-join`](#string-join) # mta:code-gen @@ -46,9 +45,4 @@ Call `emits` for each of the given strings. `display` a newline to the current output port. -# string-join - - (string-join list deliminator) - -Create a single string from a list of strings, adding `deliminator` between each of the strings. diff --git a/docs/api/scheme/cyclone/util.md b/docs/api/scheme/cyclone/util.md index 73090377..fae74c8c 100644 --- a/docs/api/scheme/cyclone/util.md +++ b/docs/api/scheme/cyclone/util.md @@ -60,7 +60,9 @@ The `(scheme cyclone util`) library contains various utility functions. - [`set!->exp `](#set-exp) - [`set!->var `](#set-var) - [`set!? `](#set) +- [`string-join `](#string-join) - [`string-replace-all `](#string-replace-all) +- [`string-split `](#string-split) - [`tagged-list? `](#tagged-list?) - [`take `](#take) @@ -180,8 +182,21 @@ The `(scheme cyclone util`) library contains various utility functions. # set!? +# string-join + + (string-join list deliminator) + +Create a single string from a list of strings, adding `deliminator` between each of the strings. `deliminator` may be either a character or string. + # string-replace-all +# string-split + + (string-split string deliminator) + +Create a list of strings from the given string, creating a new one at each instance of the `deliminator` character. + + # tagged-list? # take diff --git a/scheme/cyclone/cgen.sld b/scheme/cyclone/cgen.sld index e2dbdc16..7cdd74f0 100644 --- a/scheme/cyclone/cgen.sld +++ b/scheme/cyclone/cgen.sld @@ -54,18 +54,6 @@ (define (emit-newline) (newline)) -(define (string-join lst delim) - (cond - ((null? lst) - "") - ((= (length lst) 1) - (car lst)) - (else - (string-append - (car lst) - delim - (string-join (cdr lst) delim))))) - ;; Escape chars in a C-string, so it can be safely written to a C file (define (cstr:escape-chars str) (letrec ((next (lambda (head tail)