diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-03-13 23:27:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-03-13 23:39:17 -0700 |
commit | a470a6705f13b1d57cdcc865e77e11e7aa413e34 (patch) | |
tree | 7b9a966931a7cd84ed4c69d1dddbfa55c2f3c340 /lib.c | |
parent | 7aef72ae4fd0fcbe18acbbd876fed0aaf6bf87ee (diff) | |
download | txr-a470a6705f13b1d57cdcc865e77e11e7aa413e34.tar.gz txr-a470a6705f13b1d57cdcc865e77e11e7aa413e34.tar.bz2 txr-a470a6705f13b1d57cdcc865e77e11e7aa413e34.zip |
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.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); |