summaryrefslogtreecommitdiffstats
path: root/tests/002
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-11-19 07:06:22 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-11-20 16:17:19 -0800
commiteb483eb39fa4570d1178a3f71fb65be908fd0d01 (patch)
tree4668efdc1c3c407e2ff21c0559cb23800a0471ce /tests/002
parentec5daf6385b68f08e82c106a925a758cf2b2bf14 (diff)
downloadtxr-eb483eb39fa4570d1178a3f71fb65be908fd0d01.tar.gz
txr-eb483eb39fa4570d1178a3f71fb65be908fd0d01.tar.bz2
txr-eb483eb39fa4570d1178a3f71fb65be908fd0d01.zip
Introducing lazy structs.
* share/txr/stdlib/struct.tl (lnew): New macro. * struct.c (struct_type): Turn id into a bitfield one bit smaller than cnum. New Boolean bitfield lazy. (struct_init): Register make-lazy-struct intrinsic. (make_struct): Initialize lazy bitfield to zero. (lazy_struct_init, check_init_lazy_struct): New static functions. (make_lazy_struct): New function. (copy_struct, clear_struct, replace_struct, reset_struct, lookup_slot, struct_inst_equal, struct_inst_hash): Call check_init_lazy_struct on all structures involved. (lookup_slot): Call check_init_lazy_struct. (struct_inst_mark): If the struct is lazy, it has one instance slot which must be marked, holding the argfun function passed into make_lazy_struct. * struct.h (make_lazy_struct): Declared. * txr.1: Documented lnew and make-lazy-struct.
Diffstat (limited to 'tests/002')
0 files changed, 0 insertions, 0 deletions