From aebdc3d7c22820d7604f2c424cbc179d7ebb34d1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 6 Sep 2019 06:58:48 -0700 Subject: 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. --- txr.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 6bb2fc08..c2ee8823 100644 --- a/txr.1 +++ b/txr.1 @@ -69566,6 +69566,16 @@ of these version values, the described behaviors are provided if is given an argument which is equal or lower. For instance .code "-C 103" selects the behaviors described below for version 105, but not those for 102. +.IP 224 +After \*(TX 224, the treatment of certain special structure functions +has changed. Selecting 224 compatibility or lower restores that behavior. +The specification given in the +.B "Special Structure Functions" +paragraph has always stated that special functions must be static slots, +and that the behavior is unspecified if they are instance slots. +The behavior of \*(TX 224 and earlier was that these functions worked anyway +if they were instance slots; after \*(TX 224, they some special functions +will no longer be recognized if bound to instance slots. .IP 222 After \*(TX 222, the behavior of .code :vars -- cgit v1.2.3