Leonardo Bitsch writes:
> I want that this code read (and compile) the file until the end
> of file and not only the line (with "read-line"). How can I do this?
One possibility is that you write a function 'read-contents' which
reads the contents of a stream until EOF, and returns it as a string.
Another possibility, if the stream may contain multiple Lisp forms, is
to call (load stream). 'load' also accepts streams, not only filenames.
Bruno

I have this code to read from a file some algorithm that came from a HTML
text area. I want that this code read (and compile) the file until the end
of file and not only the line (with "read-line"). How can I do this?
Thanks,
(setf *error-output* (open "erro" :direction :output))
(setf *standard-output* (open "saida" :direction :output))
(setf ?arq (open "input.lsp"))
(handler-case
(loop
(eval (read-from-string (read-line ?arq)))
)
(stream-error () (read-from-string "fim_do_arquivo")))
(cerror "Nenhum erro foi encontrado no c&oacute;digo fornecido!")
(close *error-output*)
(close *standard-output*)