From 67ac7a217bdfd6e4a813cc6caa68a75fb754e28b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 5 Mar 2014 00:16:37 -0800 Subject: * 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. --- stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stream.c') diff --git a/stream.c b/stream.c index 3a3d2d77..5761894e 100644 --- a/stream.c +++ b/stream.c @@ -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)); -- cgit v1.2.3