> #;1> (require-extension stream-wiki) > ; loading /usr/lib/chicken/stream-wiki.so ... > ; loading /usr/lib/chicken/srfi-40-base.so ... > ; loading /usr/lib/chicken/stream-ext.so ... > ; loading /usr/lib/chicken/format.so ... > ; loading /usr/lib/chicken/stream-parser-base.so ... > ; loading /usr/lib/chicken/sandbox.so ... > #;2> (define inp (open-input-file > "/var/www/localhost/htdocs/wiki/index.wiki")) > #;3> (define ins (wiki->html inp)) > #;4> (stream? ins) > #t > #;5> (stream->string ins) > Error: stream library: "attempt to take stream-car of non-stream"
wiki->html expects a stream of characters to operate on, not a port. You can use port->stream to get a stream with all the characters on a given port; characters will be read from the port as they are taken from the string. Thus, your example could work like this: #;1> (use stream-wiki) ; ... #;2> (stream->string (wiki->html (port->stream (open-input-file "/tmp/index.wiki")))) "<p>This is a <a href='test' class='internal'>test</a>.</p>" BTW, you may be confused by (stream? ins) returning #t in your example (and the error being caught by stream->string rather than wiki->html). This is normal due to the lazy semantics of streams. Hmm. I've added a lot of optional parameters to wiki->html to provide further control to the caller. Maybe I should document those... Thanks. Alejo. http://azul.freaks-unidos.net/ ---=( Comunidad de Usuarios de Software Libre en Colombia )=--- ---=( http://bachue.com/colibri )=--=( [EMAIL PROTECTED] )=--- _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users