From 08ee01ea9e6bd1bedd565f9e0e1c1a8938710887 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 8 Dec 2009 13:48:19 -0800 Subject: All COBJ operations have default implementations now; no null pointer check over struct cobj_ops operations. New typechecking function for COBJ objects. --- lib.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 679cbdc0..b38212c5 100644 --- a/lib.c +++ b/lib.c @@ -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; -- cgit v1.2.3