[plt-scheme] mzc: can't compile this

From: Mike T. Machenry (dskippy at ccs.neu.edu)
Date: Fri Jun 14 20:31:59 EDT 2002

i am have a problem compiling this piece of code. it runs properly
but when i compile it, the resultant binary gives the following error
when run.

call-with-input-file: expects type <string> as first argument. given
#f. other arguments were #<primitive:read>

as you see i am not calling call-with-input file. i suspect the html
read is likely doing that.

(module msml2xhtml
  (require
    (lib "xml.ss" "xml")
    (lib "html.ss" "html"))
  
  ;;convert: input-port output-port -> (void)
  ;;reads in html from the input-port and rights it to the output port
  (define convert
    (lambda (in out)
      (write-xml/content
        (car (read-html-as-xml in))
        out)))

  ;;this line runs the code. i have another script to run this
  ;;line, but for the compiler it's said in the docs that the
  ;;code should all be in a module.
  (convert (current-input-port) (current-output-port))
)

  this script should read in standard in and print to standard out. i am
trying to compile the code with
mzc --exe msml2xhtml msml2xhtml.ss
i also tried copiling the script but it tells me that it is not a module.

thanks for the help.
-mike



Posted on the users mailing list.