GNU bug report logs -
#14109
No code for 'bytevector->string' and 'string->bytevector'
Previous Next
Full log
View this message in rfc822 format
Nikita Karetnikov <nikita <at> karetnikov.org> writes:
> The mentioned functions are documented [1]. However, I'll get the
> "Unbound variable" error if I try to import them:
>
> scheme@(guile-user)> ,use (rnrs io ports)
> scheme@(guile-user)> string->bytevector
> ;;; <unknown-location>: warning: possibly unbound variable `string->bytevector'
> ERROR: In procedure #<procedure 8ab8bc0 ()>:
> ERROR: In procedure module-lookup: Unbound variable: string->bytevector
Even if they were available, it wouldn't do you much good, because the
general transcoder functionality on ports isn't implemented.
e.g.
scheme@(guile−user)> (open-bytevector-input-port
(string->utf8 "foobarbaz")
(make-transcoder (utf-8-codec)))
GNU Guile: warning: transcoders not implemented
$5 = #<input: r6rs−bytevector−input−port ae46b40>
Maybe we could stub these, since they are mentioned in the info file[0],
and warn about them not being implemented like we do e.g. with
open-bytevector-input-port.
For the moment, the (rnrs bytevectors) module has string->utf8,
string->utf16, and string->utf32 which are implemented. Though, this
doesn't let you specify eol-style or handling-mode.
0. This documentation is lifted straight from the R6RS (modulo
formatting).
--
Ian Price -- shift-reset.com
"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"
This bug report was last modified 11 years and 256 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.