diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-09-06 06:58:48 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-09-06 06:58:48 -0700 |
commit | aebdc3d7c22820d7604f2c424cbc179d7ebb34d1 (patch) | |
tree | 6bea563acba130e47b19ec10b4b2d04fdf012cae /ffi.c | |
parent | 13732bc2f2f66d992dfaabddd7440b7018d9b562 (diff) | |
download | txr-aebdc3d7c22820d7604f2c424cbc179d7ebb34d1.tar.gz txr-aebdc3d7c22820d7604f2c424cbc179d7ebb34d1.tar.bz2 txr-aebdc3d7c22820d7604f2c424cbc179d7ebb34d1.zip |
lib: access special methods via special slot mechanism.
* ffi.c (ffi_flex_struct_in): Use get_special_slot to obtain
length method.
* lib.c (nullify_s, from_list_s, lambda_set_s): Definitions
removed from here.
(seq_info, car, cdr, rplaca, rplacd, make_like, nullify,
replace_obj, length, empty, sub, ref, refset, dwim_set): Use
get_special_slot to obtain special method from object,
rather than maybe_slot.
(obj_init): Remove initializations of nullify_s, from_list_s
and lambda_set_s from here.
* struct.c (enum special_slot): Definition removed from here.
(nullify_s, from_list_s, lambda_set_s): Definitions moved here
from lib.c.
(special_sym): New static array.
(struct_init): Initializations of nullify_s, from_list_s
and lambda_set_s moved here from lib.c.
(get_special_slot): New function.
* struct.h (lambda_set_s): Declared.
(enum special_slot): Definition moved here.
(get_special_slot): Declared.
* txr.1: Added compat note, since get_special_slot behaves
like maybe_slot under 224 compatibility.
Diffstat (limited to 'ffi.c')
-rw-r--r-- | ffi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2050,7 +2050,7 @@ static void ffi_ptr_in_release(struct txr_ffi_type *tft, val obj, mem_t *dst) static val ffi_flex_struct_in(struct txr_ffi_type *tft, val strct, val self) { struct smemb *lastm = &tft->memb[tft->nelem - 1]; - val length_meth = maybe_slot(strct, length_s); + val length_meth = get_special_slot(strct, length_m); if (length_meth) { val len = funcall1(length_meth, strct); |