diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-05-07 18:55:09 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-05-07 18:55:09 -0700 |
commit | 85e80eb7f9dcc3e24b8a2d618525a4ce901d3982 (patch) | |
tree | 6e6e90066658d62acf64bbffbad2e08a4d8cdbe7 /stream.c | |
parent | 52fb4be87f0b7c398084866393ac4ce3842272aa (diff) | |
download | txr-85e80eb7f9dcc3e24b8a2d618525a4ce901d3982.tar.gz txr-85e80eb7f9dcc3e24b8a2d618525a4ce901d3982.tar.bz2 txr-85e80eb7f9dcc3e24b8a2d618525a4ce901d3982.zip |
Argument of flush-stream now optional.
* stream.c (flush_stream): Default the argument to
std_output.
(stream_init): Register flush-stream as having one
optional arg.
* txr.1: Updated flush-stream description.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -3222,8 +3222,9 @@ val put_lines(val lines, val stream) return t; } -val flush_stream(val stream) +val flush_stream(val stream_in) { + val stream = default_arg(stream_in, std_output); struct strm_ops *ops = coerce(struct strm_ops *, cobj_ops(stream, stream_s)); return ops->flush(stream); } @@ -3963,7 +3964,7 @@ void stream_init(void) reg_fun(intern(lit("put-strings"), user_package), func_n2o(put_strings, 1)); reg_fun(intern(lit("unget-char"), user_package), func_n2o(unget_char, 1)); reg_fun(intern(lit("unget-byte"), user_package), func_n2o(unget_byte, 1)); - reg_fun(intern(lit("flush-stream"), user_package), func_n1(flush_stream)); + reg_fun(intern(lit("flush-stream"), user_package), func_n1o(flush_stream, 0)); reg_fun(intern(lit("seek-stream"), user_package), func_n3(seek_stream)); reg_fun(intern(lit("truncate-stream"), user_package), func_n2(truncate_stream)); reg_fun(intern(lit("streamp"), user_package), func_n1(streamp)); |