diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-03-05 00:16:37 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-03-05 00:16:37 -0800 |
commit | 67ac7a217bdfd6e4a813cc6caa68a75fb754e28b (patch) | |
tree | 2a4f50e9ae3bc421b0ad7a91de130a4ed0ac7a38 /stream.c | |
parent | 22ed7f473a5c1e1db722286f98b2457a74cc1ca7 (diff) | |
download | txr-67ac7a217bdfd6e4a813cc6caa68a75fb754e28b.tar.gz txr-67ac7a217bdfd6e4a813cc6caa68a75fb754e28b.tar.bz2 txr-67ac7a217bdfd6e4a813cc6caa68a75fb754e28b.zip |
* stream.c (put_line): Default string argument to empty string.
(stream_init): Change how put_line is registered to take advantage of
new optional parameter.
* txr.1: Updated.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1968,7 +1968,7 @@ val put_byte(val byte, val stream) val put_line(val string, val stream) { - return (put_string(string, stream), put_char(chr('\n'), stream)); + return (put_string(default_arg(string, null_string), stream), put_char(chr('\n'), stream)); } val flush_stream(val stream) @@ -2678,7 +2678,7 @@ void stream_init(void) reg_fun(intern(lit("get-char"), user_package), func_n1o(get_char, 0)); reg_fun(intern(lit("get-byte"), user_package), func_n1o(get_byte, 0)); reg_fun(intern(lit("put-string"), user_package), func_n2o(put_string, 1)); - reg_fun(intern(lit("put-line"), user_package), func_n2o(put_line, 1)); + reg_fun(intern(lit("put-line"), user_package), func_n2o(put_line, 0)); reg_fun(intern(lit("put-char"), user_package), func_n2o(put_char, 1)); reg_fun(intern(lit("put-byte"), user_package), func_n2o(put_byte, 1)); reg_fun(intern(lit("unget-char"), user_package), func_n2o(unget_char, 1)); |