print_text_stream stream ==
  if stream then
    while (str := read_line stream) repeat
      WRITE_-LINE str

print_text_file filename ==
  handle_input_file(filename, function print_text_stream, [])

====

Shall we use "WRITE_-LINE" or define "|write_line|" or use
"SAY" or "PRINC"?

And is there a better place to put it other than i-syscmd.boot?

- Qian


On 12/10/23 10:51, Waldek Hebisch wrote:
On Sun, Dec 10, 2023 at 10:29:01AM +0800, Qian Yun wrote:
"with-open-file" is hard to express in Boot, right?

To use "open" directly, there's risk when IO error happens,
file handler are not properly "close".

We have 'handle_input_file' which is a wrapper around
'with-open-file'.  Since there is no macros in Boot,
'handle_input_file' takes a function as an argument.


--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/8a2762d7-a07a-4bc0-9043-efda4205f966%40gmail.com.

Reply via email to