summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-02-16 18:56:39 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-02-16 18:56:39 -0800
commit8c299f44b94d4462147b9e3cb782c52c3669a1e5 (patch)
treef1ea94cd5de6f808696c1bb168d99b7c8766902c /stream.c
parentdcd14af875e74e92379031076d48c526b57a06bf (diff)
downloadtxr-8c299f44b94d4462147b9e3cb782c52c3669a1e5.tar.gz
txr-8c299f44b94d4462147b9e3cb782c52c3669a1e5.tar.bz2
txr-8c299f44b94d4462147b9e3cb782c52c3669a1e5.zip
* eval.c (eval_init): Register match-fun.
* match.c (v_do): Store match context. (match_fun): New function. * match.h (match_fun): Declared. * stream.c (streamp): New function. * stream.h (streamp): Declared. * txr.1: Stub section for match-fun. * txr.vim: Highlight match-fun.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stream.c b/stream.c
index ac14a83c..023e8390 100644
--- a/stream.c
+++ b/stream.c
@@ -680,6 +680,11 @@ val make_dir_stream(DIR *dir)
return cobj((mem_t *) dir, stream_s, &dir_ops.cobj_ops);
}
+val streamp(val obj)
+{
+ return typeof(obj) == stream_s ? t : nil;
+}
+
val close_stream(val stream, val throw_on_error)
{
type_check (stream, COBJ);