update benz (conversion functions)
This commit is contained in:
parent
b84004770a
commit
22a04a59a2
|
@ -1 +1 @@
|
||||||
Subproject commit a2f0d7f7ac4647e3ffbe488169300abb5fedbf16
|
Subproject commit 0f2a172ffcdce1e9732dd157f343b2aa0e1960db
|
|
@ -124,15 +124,19 @@
|
||||||
assoc)
|
assoc)
|
||||||
|
|
||||||
(export bytevector?
|
(export bytevector?
|
||||||
|
bytevector
|
||||||
make-bytevector
|
make-bytevector
|
||||||
bytevector-length
|
bytevector-length
|
||||||
bytevector-u8-ref
|
bytevector-u8-ref
|
||||||
bytevector-u8-set!
|
bytevector-u8-set!
|
||||||
bytevector-copy
|
bytevector-copy
|
||||||
bytevector-copy!
|
bytevector-copy!
|
||||||
bytevector-append)
|
bytevector-append
|
||||||
|
bytevector->list
|
||||||
|
list->bytevector)
|
||||||
|
|
||||||
(export vector?
|
(export vector?
|
||||||
|
vector
|
||||||
make-vector
|
make-vector
|
||||||
vector-length
|
vector-length
|
||||||
vector-ref
|
vector-ref
|
||||||
|
@ -142,9 +146,12 @@
|
||||||
vector-append
|
vector-append
|
||||||
vector-fill!
|
vector-fill!
|
||||||
list->vector
|
list->vector
|
||||||
vector->list)
|
vector->list
|
||||||
|
string->vector
|
||||||
|
vector->string)
|
||||||
|
|
||||||
(export string?
|
(export string?
|
||||||
|
string
|
||||||
make-string
|
make-string
|
||||||
string-length
|
string-length
|
||||||
string-ref
|
string-ref
|
||||||
|
|
|
@ -380,9 +380,6 @@
|
||||||
|
|
||||||
;; 6.7. Strings
|
;; 6.7. Strings
|
||||||
|
|
||||||
(define (string . objs)
|
|
||||||
(list->string objs))
|
|
||||||
|
|
||||||
(export string?
|
(export string?
|
||||||
string
|
string
|
||||||
make-string
|
make-string
|
||||||
|
@ -392,32 +389,20 @@
|
||||||
string-copy
|
string-copy
|
||||||
string-copy!
|
string-copy!
|
||||||
string-append
|
string-append
|
||||||
|
(rename string-copy substring)
|
||||||
string-fill!
|
string-fill!
|
||||||
|
string->list
|
||||||
|
list->string
|
||||||
string=?
|
string=?
|
||||||
string<?
|
string<?
|
||||||
string>?
|
string>?
|
||||||
string<=?
|
string<=?
|
||||||
string>=?
|
string>=?)
|
||||||
string->list
|
|
||||||
list->string
|
|
||||||
(rename string-copy substring))
|
|
||||||
|
|
||||||
;; 6.8. Vectors
|
;; 6.8. Vectors
|
||||||
|
|
||||||
(define (vector . objs)
|
|
||||||
(list->vector objs))
|
|
||||||
|
|
||||||
(define (vector->string . args)
|
|
||||||
(list->string (apply vector->list args)))
|
|
||||||
|
|
||||||
(define (string->vector . args)
|
|
||||||
(list->vector (apply string->list args)))
|
|
||||||
|
|
||||||
(export vector
|
|
||||||
vector->string
|
|
||||||
string->vector)
|
|
||||||
|
|
||||||
(export vector?
|
(export vector?
|
||||||
|
vector
|
||||||
make-vector
|
make-vector
|
||||||
vector-length
|
vector-length
|
||||||
vector-ref
|
vector-ref
|
||||||
|
@ -427,28 +412,11 @@
|
||||||
vector-append
|
vector-append
|
||||||
vector-fill!
|
vector-fill!
|
||||||
list->vector
|
list->vector
|
||||||
vector->list)
|
vector->list
|
||||||
|
string->vector
|
||||||
|
vector->string)
|
||||||
|
|
||||||
;; 6.9. bytevector
|
;; 6.9. Bytevectors
|
||||||
|
|
||||||
(define (bytevector->list v start end)
|
|
||||||
(do ((i start (+ i 1))
|
|
||||||
(res '()))
|
|
||||||
((= i end)
|
|
||||||
(reverse res))
|
|
||||||
(set! res (cons (bytevector-u8-ref v i) res))))
|
|
||||||
|
|
||||||
(define (list->bytevector list)
|
|
||||||
(let ((len (length list)))
|
|
||||||
(let ((v (make-bytevector len)))
|
|
||||||
(do ((i 0 (+ i 1))
|
|
||||||
(l list (cdr l)))
|
|
||||||
((= i len)
|
|
||||||
v)
|
|
||||||
(bytevector-u8-set! v i (car l))))))
|
|
||||||
|
|
||||||
(define (bytevector . objs)
|
|
||||||
(list->bytevector objs))
|
|
||||||
|
|
||||||
(define (utf8->string v . opts)
|
(define (utf8->string v . opts)
|
||||||
(let ((start (if (pair? opts) (car opts) 0))
|
(let ((start (if (pair? opts) (car opts) 0))
|
||||||
|
|
Loading…
Reference in New Issue