summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-08 07:01:42 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-08 07:01:42 -0700
commit94d029b0f24756b84a94ce2b3f8fd5739166b0c5 (patch)
tree8b12005298141f11225387bd75a3e38898f4e627 /lib.h
parentf72fa1121f2571aba9f16f95d58d8e915965d765 (diff)
downloadtxr-94d029b0f24756b84a94ce2b3f8fd5739166b0c5.tar.gz
txr-94d029b0f24756b84a94ce2b3f8fd5739166b0c5.tar.bz2
txr-94d029b0f24756b84a94ce2b3f8fd5739166b0c5.zip
New functions, subtypep and typep.
* eval.c (eval_init): Register subtypep and typep. * eval.h (list_s): Existing variable declared. * lib.c (atom_s, integer_s, number_s, sequence_s, string_s): new symbol variables. (subtypep, typep): New functions. (obj_init): Initialize new symbol variables. * lib.c (atom_s, integer_s, number_s, sequence_s, string_s): Declared. * txr.1: Documented type hierarchy and the new functions.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 6b8a9d6e..074ccd3c 100644
--- a/lib.h
+++ b/lib.h
@@ -386,6 +386,7 @@ extern val keyword_package_s, system_package_s, user_package_s;
extern val null_s, t, cons_s, str_s, chr_s, fixnum_sl;
extern val sym_s, pkg_s, fun_s, vec_s;
extern val stream_s, hash_s, hash_iter_s, lcons_s, lstr_s, cobj_s, cptr_s;
+extern val atom_s, integer_s, number_s, sequence_s, string_s;
extern val env_s, bignum_s, float_s;
extern val var_s, expr_s, regex_s, chset_s, set_s, cset_s, wild_s, oneplus_s;
extern val nongreedy_s;
@@ -432,6 +433,8 @@ extern alloc_bytes_t gc_bytes;
val identity(val obj);
val typeof(val obj);
+val subtypep(val sub, val sup);
+val typep(val obj, val type);
val throw_mismatch(val obj, type_t);
INLINE val type_check(val obj, type_t typecode)
{