Request: bytevector->string and string->bytevector
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ikarus Scheme |
Fix Committed
|
Low
|
Abdulaziz Ghuloum |
Bug Description
I was able to make my own, so this is low priority for me, but I should use the ones from (rnrs). Here are mine:
Ikarus Scheme version 0.0.3+ (revision 1527, build 2008-07-02)
Copyright (c) 2006-2008 Abdulaziz Ghuloum
>
(define (bytevector->string bv t)
(call-with-port (open-bytevecto
(lambda (tcip)
(let ([r (get-string-all tcip)])
(if (eof-object? r) "" r)))))
>
(define (string->bytevector str t)
(call-
(lambda (tcop)
(put-string tcop str))
t))
>
> (string->bytevector "This is a sentence." (native-
#vu8(84 104 105 115 32 105 115 32 97 32 115 101 110 116 101 110 99 101 46)
> (bytevector->string #vu8(40 40 206 187 32 40 120 41 32 40 120 32 120 41 41 32 40 206 187 32 40 120 41 32 40 120 32 120 41 41 41) (native-
"((λ (x) (x x)) (λ (x) (x x)))"
>
Related branches
Changed in ikarus: | |
importance: | Undecided → Low |
Changed in ikarus: | |
assignee: | nobody → aghuloum |
status: | New → Confirmed |
Changed in ikarus: | |
milestone: | none → 0.0.4 |
fixed in 1531.