diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-04-14 06:25:01 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-04-14 06:25:01 -0700 |
commit | f5aa16fcc4431d7134da691891b489f6a74da944 (patch) | |
tree | df63e0d94238d60822f940a710c54ce3e498ad5e /stream.c | |
parent | 6e6a0e0e8a2391725a916511864acd0e02556703 (diff) | |
download | txr-f5aa16fcc4431d7134da691891b489f6a74da944.tar.gz txr-f5aa16fcc4431d7134da691891b489f6a74da944.tar.bz2 txr-f5aa16fcc4431d7134da691891b489f6a74da944.zip |
Adding fmt function.
* stream.c (fmt): New function.
* stream.h (fmt): Declared.
* txr.1: Documented.
Diffstat (limited to 'stream.c')
-rw-r--r-- | stream.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -3095,6 +3095,11 @@ val format(val stream, val str, ...) } } +val fmt(val string, struct args *args) +{ + return formatv(nil, string, args); +} + static val put_indent(val stream, struct strm_ops *ops, cnum chars) { while (chars--) @@ -3800,6 +3805,7 @@ void stream_init(void) #endif reg_fun(format_s, func_n2v(formatv)); + reg_fun(intern(lit("fmt"), user_package), func_n1v(fmt)); reg_fun(intern(lit("make-string-input-stream"), user_package), func_n1(make_string_input_stream)); reg_fun(intern(lit("make-string-byte-input-stream"), user_package), func_n1(make_string_byte_input_stream)); reg_fun(intern(lit("make-string-output-stream"), user_package), func_n0(make_string_output_stream)); |