This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: rfc 2045 base64 encoding/decoding module
At 20:09 31/01/2000 +0900, sen_ml@eccosys.com wrote:
>
>the routines work on strings and i was wondering whether it might be
>better for them to work on ports. does anyone have any opinions
>regarding this matter?
I like the port abstraction. If you provide an API with ports, then you
can use it easily with files (call-with-input-file "file" encode-base64),
strings (call-with-input-string "string" encode-base64)... But it would
require a few changes in your functions, since you use the length of the
input string to preallocate the output string. Mixing recursion and
iteration would seem natural here : read some amount of data from the port,
convert it as you already do it, then start again recursively until there
is nothing more in the port.
--
Thierry Bézecourt
bezecourt@globeid.com