diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-10-18 05:39:48 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-10-18 05:39:48 -0700 |
commit | 609a4db665bbbc782ab34e88d9f054b6e0d76219 (patch) | |
tree | 859aba874523d6e0598198ff285337e2c813b8b7 | |
parent | 557fc8f813618be7c54c39d40ce2d61e910e449b (diff) | |
download | txr-609a4db665bbbc782ab34e88d9f054b6e0d76219.tar.gz txr-609a4db665bbbc782ab34e88d9f054b6e0d76219.tar.bz2 txr-609a4db665bbbc782ab34e88d9f054b6e0d76219.zip |
New function to access slot list of struct type.
* struct.c (slots): New function.
* struct.h (slots): Declared.
-rw-r--r-- | struct.c | 6 | ||||
-rw-r--r-- | struct.h | 1 |
2 files changed, 7 insertions, 0 deletions
@@ -1085,6 +1085,12 @@ val static_slot_p(val type, val sym) return nil; } +val slots(val stype) +{ + struct struct_type *st = stype_handle(&stype, lit("static-slot-p")); + return st->slots; +} + val structp(val obj) { return tnil(cobjp(obj) && obj->co.ops == &struct_inst_ops); @@ -47,6 +47,7 @@ val static_slot_set(val stype, val sym, val newval); val static_slot_ensure(val stype, val sym, val newval, val no_error_p); val slotp(val type, val sym); val static_slot_p(val type, val sym); +val slots(val stype); val structp(val obj); val struct_type(val strct); val method(val strct, val slotsym); |