~ chicken-core (chicken-5) 09c6dc9f2d77e2c5d1b4cfcdcef2377b2d92ed81
commit 09c6dc9f2d77e2c5d1b4cfcdcef2377b2d92ed81 Author: Evan Hanson <evhan@foldling.org> AuthorDate: Mon Aug 21 18:31:52 2017 +1200 Commit: Peter Bex <peter@more-magic.net> CommitDate: Mon Aug 21 18:58:53 2017 +0200 Update types.db entries for chicken.string procedures Also, move the `reverse-string->list' procedure into (chicken string). Signed-off-by: Peter Bex <peter@more-magic.net> diff --git a/chicken.import.scm b/chicken.import.scm index dac5a4df..ad4b677f 100644 --- a/chicken.import.scm +++ b/chicken.import.scm @@ -159,7 +159,6 @@ (repository-path . chicken.platform#repository-path) (require . chicken.load#require) return-to-host - reverse-list->string set-port-name! setter (signal . chicken.condition#signal) diff --git a/compiler-syntax.scm b/compiler-syntax.scm index 0ced9e4d..1311b0c0 100644 --- a/compiler-syntax.scm +++ b/compiler-syntax.scm @@ -211,7 +211,7 @@ (push (if (= 1 (length chunk)) `(##sys#write-char-0 ,(car chunk) ,%out) - `(##sys#print ,(reverse-list->string chunk) #f ,%out))))) + `(##sys#print ,(##sys#reverse-list->string chunk) #f ,%out))))) (define (push exp) (set! code (cons exp code))) (let loop ((chunk '())) diff --git a/data-structures.scm b/data-structures.scm index 9430d0fb..fb09dbac 100644 --- a/data-structures.scm +++ b/data-structures.scm @@ -278,7 +278,7 @@ (module chicken.string (conc ->string string-chop string-chomp string-compare3 string-compare3-ci - reverse-string-append + reverse-list->string reverse-string-append string-intersperse string-split string-translate string-translate* substring=? substring-ci=? @@ -305,6 +305,9 @@ (make-string i))) (rev-string-append l 0)) +(define (reverse-list->string l) + (##sys#reverse-list->string l)) + ;;; Anything->string conversion: (define ->string diff --git a/library.scm b/library.scm index ce1bbf23..f1c20832 100644 --- a/library.scm +++ b/library.scm @@ -662,7 +662,7 @@ EOF ;;; By Sven Hartrumpf: -(define (reverse-list->string l) +(define (##sys#reverse-list->string l) (if (list? l) (let* ((n (length l)) (s (##sys#make-string n))) @@ -675,8 +675,6 @@ EOF s ) (##sys#error-not-a-proper-list l 'reverse-list->string) ) ) -(define ##sys#reverse-list->string reverse-list->string) - (define (string-fill! s c) (##sys#check-string s 'string-fill!) (##sys#check-char c 'string-fill!) diff --git a/types.db b/types.db index b59408fd..85fb1fb4 100644 --- a/types.db +++ b/types.db @@ -1293,7 +1293,6 @@ (rename-file (#(procedure #:clean #:enforce) rename-file (string string) string)) (return-to-host (procedure return-to-host () . *)) -(reverse-list->string (#(procedure #:clean #:enforce) reverse-list->string ((list-of char)) string)) ;; gc @@ -1440,11 +1439,35 @@ (##sys#provided? (procedure ##sys#provided? (symbol) boolean) ((symbol) (##core#inline "C_i_providedp" #(1)))) +;; string -;; data-structures +(chicken.string#->string (procedure chicken.string#->string (*) string) + ((string) #(1))) + +(chicken.string#conc (procedure chicken.string#conc (#!rest) string)) + +(chicken.string#string-chomp (#(procedure #:clean #:enforce) chicken.string#string-chomp (string #!optional string) string)) +(chicken.string#string-chop (#(procedure #:clean #:enforce) chicken.string#string-chop (string fixnum) (list-of string))) +(chicken.string#string-compare3 (#(procedure #:clean #:enforce) chicken.string#string-compare3 (string string) fixnum)) +(chicken.string#string-compare3-ci (#(procedure #:clean #:enforce) chicken.string#string-compare3-ci (string string) fixnum)) +(chicken.string#string-intersperse (#(procedure #:clean #:enforce) chicken.string#string-intersperse ((list-of string) #!optional string) string)) +(chicken.string#string-split (#(procedure #:clean #:enforce) chicken.string#string-split (string #!optional string *) (list-of string))) +(chicken.string#string-translate (#(procedure #:clean #:enforce) chicken.string#string-translate (string * #!optional *) string)) +(chicken.string#string-translate* (#(procedure #:clean #:enforce) chicken.string#string-translate* (string (list-of (pair string string))) string)) + +(chicken.string#substring=? (#(procedure #:clean #:enforce #:foldable) chicken.string#substring=? (string string #!optional fixnum fixnum fixnum) boolean)) +(chicken.string#substring-ci=? (#(procedure #:clean #:enforce #:foldable) chicken.string#substring-ci=? (string string #!optional fixnum fixnum fixnum) boolean)) +(chicken.string#substring-index (#(procedure #:clean #:enforce #:foldable) chicken.string#substring-index (string string #!optional fixnum) (or false fixnum)) + ((* *) (##sys#substring-index #(1) #(2) '0)) + ((* * *) (##sys#substring-index #(1) #(2) #(3)))) +(chicken.string#substring-index-ci (#(procedure #:clean #:enforce #:foldable) chicken.string#substring-index-ci (string string #!optional fixnum) (or false fixnum)) + ((* *) (##sys#substring-index-ci #(1) #(2) '0)) + ((* * *) (##sys#substring-index-ci #(1) #(2) #(3)))) -(chicken.data-structures#->string (procedure chicken.data-structures#->string (*) string) - ((string) #(1))) +(chicken.string#reverse-list->string (#(procedure #:clean #:enforce) chicken.string#reverse-list->string ((list-of char)) string)) +(chicken.string#reverse-string-append (#(procedure #:clean #:enforce) chicken.string#reverse-string-append ((list-of string)) string)) + +;; data-structures (chicken.data-structures#alist-ref (forall (a b c d) @@ -1474,7 +1497,6 @@ (chicken.data-structures#complement (#(procedure #:clean #:enforce) chicken.data-structures#complement ((procedure (#!rest) *)) (procedure (#!rest) boolean))) (chicken.data-structures#compose (#(procedure #:clean #:enforce) chicken.data-structures#compose (#!rest procedure) procedure)) (chicken.data-structures#compress (forall (a) (#(procedure #:clean #:enforce) chicken.data-structures#compress (list (list-of a)) (list-of a)))) -(chicken.data-structures#conc (procedure chicken.data-structures#conc (#!rest) string)) (chicken.data-structures#conjoin (#(procedure #:clean #:enforce) chicken.data-structures#conjoin (#!rest (procedure (*) *)) (procedure (*) *))) (chicken.data-structures#constantly (forall (a) (#(procedure #:pure) chicken.data-structures#constantly (a) (procedure (#!rest) a)))) (chicken.data-structures#disjoin (#(procedure #:clean #:enforce) chicken.data-structures#disjoin (#!rest (procedure (*) *)) (procedure (*) *))) @@ -1492,37 +1514,17 @@ (forall (a b c) (#(procedure #:clean #:foldable) chicken.data-structures#rassoc (a (list-of (pair b c)) #!optional (procedure (a b) *)) (or false (pair b c))))) -(chicken.data-structures#reverse-string-append (#(procedure #:clean #:enforce) chicken.data-structures#reverse-string-append ((list-of string)) string)) - -(chicken.data-structures#string-chomp (#(procedure #:clean #:enforce) chicken.data-structures#string-chomp (string #!optional string) string)) -(chicken.data-structures#string-chop (#(procedure #:clean #:enforce) chicken.data-structures#string-chop (string fixnum) (list-of string))) -(chicken.data-structures#string-compare3 (#(procedure #:clean #:enforce) chicken.data-structures#string-compare3 (string string) fixnum)) -(chicken.data-structures#string-compare3-ci (#(procedure #:clean #:enforce) chicken.data-structures#string-compare3-ci (string string) fixnum)) -(chicken.data-structures#string-intersperse (#(procedure #:clean #:enforce) chicken.data-structures#string-intersperse ((list-of string) #!optional string) string)) -(chicken.data-structures#string-split (#(procedure #:clean #:enforce) chicken.data-structures#string-split (string #!optional string *) (list-of string))) -(chicken.data-structures#string-translate (#(procedure #:clean #:enforce) chicken.data-structures#string-translate (string * #!optional *) string)) -(chicken.data-structures#string-translate* (#(procedure #:clean #:enforce) chicken.data-structures#string-translate* (string (list-of (pair string string))) string)) -(chicken.data-structures#substring-ci=? (#(procedure #:clean #:enforce #:foldable) chicken.data-structures#substring-ci=? (string string #!optional fixnum fixnum fixnum) boolean)) - -(chicken.data-structures#substring-index (#(procedure #:clean #:enforce #:foldable) chicken.data-structures#substring-index (string string #!optional fixnum) (or false fixnum)) - ((* *) (##sys#substring-index #(1) #(2) '0)) - ((* * *) (##sys#substring-index #(1) #(2) #(3)))) (##sys#substring-index (#(procedure #:clean #:enforce #:foldable) ##sys#substring-index (string string fixnum) (or false fixnum))) -(chicken.data-structures#substring-index-ci (#(procedure #:clean #:enforce #:foldable) chicken.data-structures#substring-index-ci (string string #!optional fixnum) (or false fixnum)) - ((* *) (##sys#substring-index-ci #(1) #(2) '0)) - ((* * *) (##sys#substring-index-ci #(1) #(2) #(3)))) - (##sys#substring-index-ci (#(procedure #:clean #:enforce #:foldable) ##sys#substring-index-ci (string string fixnum) (or false fixnum))) -(chicken.data-structures#substring=? (#(procedure #:clean #:enforce #:foldable) chicken.data-structures#substring=? (string string #!optional fixnum fixnum fixnum) boolean)) (chicken.data-structures#tail? (#(procedure #:clean) chicken.data-structures#tail? (* *) boolean)) ;; ioTrap