From a470a6705f13b1d57cdcc865e77e11e7aa413e34 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 13 Mar 2019 23:27:50 -0700 Subject: oop: make struct symbol supertype of all structs. * lib.c (subtypep): If the supertype is struct, then return t if the subtype is the name of a struct type. * txr.1: Update the type graph to show the struct root, adding a note about it. --- lib.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 06cd37c1..da8e0bf7 100644 --- a/lib.c +++ b/lib.c @@ -257,6 +257,8 @@ val subtypep(val sub, val sup) return tnil(sub == str_s || sub == lit_s || sub == lstr_s); } else if (sup == stream_s) { return tnil(sub == stdio_stream_s); + } else if (sup == struct_s) { + return tnil(find_struct_type(sub)); } else { val sub_struct = find_struct_type(sub); val sup_struct = find_struct_type(sup); -- cgit v1.2.3