Added string-copy
This commit is contained in:
parent
86a28c3822
commit
2b6a3ef715
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -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)])
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -235,9 +235,9 @@
|
|||
[and i r]
|
||||
[or i r]
|
||||
[... i r]
|
||||
[=> i r]
|
||||
[else i r]
|
||||
[_ i r]
|
||||
[=> i r]
|
||||
[else i r]
|
||||
[_ i r]
|
||||
))
|
||||
|
||||
(define ikarus-procedures-map
|
||||
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue