Request: bytevector->string and string->bytevector

Bug #245983 reported by Derick Eddington
2
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-bytevector-input-port bv t)
      (lambda (tcip)
        (let ([r (get-string-all tcip)])
          (if (eof-object? r) "" r)))))
>
  (define (string->bytevector str t)
    (call-with-bytevector-output-port
      (lambda (tcop)
        (put-string tcop str))
      t))
>
> (string->bytevector "This is a sentence." (native-transcoder))
#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-transcoder))
"((λ (x) (x x)) (λ (x) (x x)))"
>

Related branches

Changed in ikarus:
importance: Undecided → Low
Changed in ikarus:
assignee: nobody → aghuloum
status: New → Confirmed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

fixed in 1531.

Changed in ikarus:
status: Confirmed → Fix Committed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

I mean 1532.

Changed in ikarus:
milestone: none → 0.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.