diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-12-08 13:48:19 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-12-08 13:48:19 -0800 |
commit | 08ee01ea9e6bd1bedd565f9e0e1c1a8938710887 (patch) | |
tree | 9d7c5017323261a681b8458b2dbd7ffe105e56fd /lib.c | |
parent | 0c86abee82a66963ec3c46e36c63ba8df89e1fa9 (diff) | |
download | txr-08ee01ea9e6bd1bedd565f9e0e1c1a8938710887.tar.gz txr-08ee01ea9e6bd1bedd565f9e0e1c1a8938710887.tar.bz2 txr-08ee01ea9e6bd1bedd565f9e0e1c1a8938710887.zip |
All COBJ operations have default implementations now;
no null pointer check over struct cobj_ops operations.
New typechecking function for COBJ objects.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -156,6 +156,14 @@ val type_check3(val obj, int t1, int t2, int t3) return t; } +val class_check(val cobj, val class_sym) +{ + type_check (cobj, COBJ); + type_assert (cobj->co.cls == class_sym, (lit("~a is not a cobj of class ~a"), + cobj, class_sym)); + return t; +} + val car(val cons) { if (cons == nil) @@ -524,6 +532,11 @@ val equal(val left, val right) internal_error("unhandled case in equal function"); } +val cobj_equal_op(val left, val right) +{ + return eq(left, right); +} + static val equal_tramp(val env, val left, val right) { (void) env; |