Added string-copy

This commit is contained in:
Abdulaziz Ghuloum 2007-08-28 12:46:12 -04:00
parent 86a28c3822
commit 2b6a3ef715
5 changed files with 17 additions and 13 deletions

Binary file not shown.

View File

@ -33,10 +33,6 @@
(match-and-bind targs (msg-arg* ...) (begin b b* ...))] ...
[else else1 else2 ...]))]))
(define string-copy
(lambda (s)
(substring s 0 (string-length s))))
(define concat-old
(lambda (str i ls)
(let ([n (sum i ls)])

View File

@ -1,7 +1,8 @@
(library (ikarus strings)
(export string-length string-ref string-set! make-string string->list string=?
string-append substring string list->string uuid)
string-append substring string list->string uuid
string-copy)
(import
(ikarus system $strings)
(ikarus system $fx)
@ -10,7 +11,7 @@
(ikarus system $pairs)
(except (ikarus) string-length string-ref string-set! make-string
string->list string=? string-append substring string
list->string uuid))
list->string uuid string-copy))
(define string-length
@ -117,6 +118,12 @@
""
(fill s ($make-string len) n m 0)))))))
(define string-copy
(lambda (s)
(if (string? s)
(substring s 0 (string-length s))
(error 'string-copy "~s is not a string" s))))
(module (string=?)
(define bstring=?
(lambda (s1 s2 i j)

View File

@ -331,6 +331,7 @@
[string=? i r]
[string-ci=? i unicode]
[substring i r]
[string-copy i r]
[string-append i r]
[string->list i r]
[list->string i r]

View File

@ -203,7 +203,7 @@
[string->number C ba]
[string->symbol C ba]
[string-append C ba]
[string-copy S ba]
[string-copy C ba]
[string-for-each S ba]
[string-length C ba]
[string-ref C ba]
@ -231,9 +231,9 @@
[vector? C ba]
[zero? C ba]
[... C ba sc]
[=> S ba ex]
[_ S ba sc]
[else S ba ex]
[=> C ba ex]
[_ C ba sc]
[else C ba ex]
[bitwise-and D bw]
[bitwise-arithmetic-shift D bw]