summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-06 15:40:47 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-06 15:40:47 -0800
commit6f051c69587d159cafbb6bcf79ba245e8ca0d6c0 (patch)
tree9f32f483a41807787a4c6b864d65404de4fd043d /lib.h
parent6cf90c4dc732318823adf7ec96e88e9e7772d4cf (diff)
downloadtxr-6f051c69587d159cafbb6bcf79ba245e8ca0d6c0.tar.gz
txr-6f051c69587d159cafbb6bcf79ba245e8ca0d6c0.tar.bz2
txr-6f051c69587d159cafbb6bcf79ba245e8ca0d6c0.zip
* eval.c (op_unwind_protect): Fixed uninitialized variable
warning. (eval_init): New functions registered: typeof and vector functions, as well as length_list. * lib.c (length): Function renamed to length_list, because it is list specific. (length_vec, size_vec, vector_list): New functions. (length): New function, generic over lists, vectors and strings. * lib.h (length_list, length_vec, size_vec, vector_list): Declared. * match.c (h_var, h_fun, robust_length, v_deffilter, v_fun): Use length_list instead of length. * parser.l: Introduced # token. * parser.y (vector): New nonterminal. (expr): vector is a kind of expr. (chrlist): Bugfix: single-character syntax was not working; for instance #\x to denote the charcter x. (lit_char_helper): Use length_list instead of length. * stream.c (string_in_get_line): Bugfix: this was using the wrong length function: length was being applied to a string. The genericity of length makes that correct now, but changing to length_str anyway. * txr.1: Blank sections created for functions. Vector syntax documented.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib.h b/lib.h
index 28bf0579..414e7726 100644
--- a/lib.h
+++ b/lib.h
@@ -339,7 +339,7 @@ val nullp(val obj);
val atom(val obj);
val listp(val obj);
val proper_listp(val obj);
-val length(val list);
+val length_list(val list);
val getplist(val list, val key);
val getplist_f(val list, val key, val *found);
val proper_plist_to_alist(val list);
@@ -456,6 +456,9 @@ val vec_set_fill(val vec, val fill);
val vecref(val vec, val ind);
val *vecref_l(val vec, val ind);
val vec_push(val vec, val item);
+val length_vec(val vec);
+val size_vec(val vec);
+val vector_list(val list);
val lazy_stream_cons(val stream);
val lazy_str(val list, val term, val limit);
val lazy_str_force_upto(val lstr, val index);
@@ -490,6 +493,7 @@ val merge(val list1, val list2, val lessfun, val keyfun);
val sort(val list, val lessfun, val keyfun);
val find(val list, val key, val testfun, val keyfun);
val set_diff(val list1, val list2, val testfun, val keyfun);
+val length(val seq);
val env(void);
val obj_print(val obj, val stream);