[plt-scheme] Re: Post a HTML file

From: Laurent (Ouaibou at gmail.com)
Date: Wed Apr 4 14:27:44 EDT 2007

> You shouldn't need to parse the file.  Just read it as a string.  You can use, for example, port->string in the port.ss collection in Planet.

Ok, I have done a function which reads a HTML file line by line :

(define (read-html f)
  (call-with-input-file f
    (lambda (p-in)
      (do ((str (read-line p-in) (read-line p-in)))
           ((eof-object? str) (printf "End file !\n"))
           (printf "~a\n" str)))))

But then, where do I have to send the code read? ? D
A editor-canvas%, a text%...?


Posted on the users mailing list.