diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-03 19:20:52 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-03 19:20:52 -0700 |
commit | a40d5455f2deb554ef3007b37441c16506f1c557 (patch) | |
tree | b3b58b03dafb887b8fea4ab8fc2dac4093ffe199 | |
parent | 9ac9586db2f2218ff7cd45a5b812b0835ad2dab2 (diff) | |
download | txr-a40d5455f2deb554ef3007b37441c16506f1c557.tar.gz txr-a40d5455f2deb554ef3007b37441c16506f1c557.tar.bz2 txr-a40d5455f2deb554ef3007b37441c16506f1c557.zip |
slot-p renamed to slotp, conforming with Lisp conventions.
* share/txr/stdlib/struct.tl (sys:prune-nil-inits):
Use of slot-p renamed.
* struct.c (struct_init): Register slotp, and make
registration of slot-p conditional on compatibility option.
(slot_p): Function renamed to slotp.
* struct.h (slot_p): Declaration renamed.
* txr.1: References to slot-p fixed to slotp. Compat notes
added.
-rw-r--r-- | share/txr/stdlib/struct.tl | 2 | ||||
-rw-r--r-- | struct.c | 8 | ||||
-rw-r--r-- | struct.h | 2 | ||||
-rw-r--r-- | txr.1 | 15 |
4 files changed, 19 insertions, 8 deletions
diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl index fb9365f2..f943c06f 100644 --- a/share/txr/stdlib/struct.tl +++ b/share/txr/stdlib/struct.tl @@ -32,7 +32,7 @@ (and (member kind '(:static :instance)) (null init-form) (or (not super-type) - (not (slot-p super-type name))))) + (not (slotp super-type name))))) slot-init-forms))) (defmacro defstruct (name-spec super . slot-specs) @@ -120,7 +120,9 @@ void struct_init(void) func_n2v(call_super_method)); reg_fun(intern(lit("call-super-fun"), user_package), func_n2v(call_super_fun)); - reg_fun(intern(lit("slot-p"), user_package), func_n2(slot_p)); + reg_fun(intern(lit("slotp"), user_package), func_n2(slotp)); + if (opt_compat && opt_compat <= 118) + reg_fun(intern(lit("slot-p"), user_package), func_n2(slotp)); reg_fun(intern(lit("static-slot-p"), user_package), func_n2(static_slot_p)); reg_fun(intern(lit("structp"), user_package), func_n1(structp)); reg_fun(intern(lit("struct-type"), user_package), func_n1(struct_type)); @@ -623,13 +625,13 @@ static val call_super_fun(val type, val sym, struct args *args) type, nao); } -val slot_p(val type, val sym) +val slotp(val type, val sym) { if (type && symbolp(type)) { val stype = find_struct_type(type); if (!stype) no_such_struct(lit("slot-p"), type); - return slot_p(stype, sym); + return slotp(stype, sym); } else { struct struct_type *st = coerce(struct struct_type *, cobj_handle(type, struct_type_s)); @@ -37,7 +37,7 @@ val slot(val strct, val sym); val slotset(val strct, val sym, val newval); val static_slot(val stype, val sym); val static_slot_set(val stype, val sym, val newval); -val slot_p(val type, val sym); +val slotp(val type, val sym); val static_slot_p(val type, val sym); val structp(val obj); val struct_type(val strct); @@ -18691,13 +18691,13 @@ function, doesn't return a method whose leftmost argument is already bound to an object; the binding occurs at call time. -.coNP Function @ slot-p +.coNP Function @ slotp .synb -.mets (slot-p < type << name ) +.mets (slotp < type << name ) .syne .desc The -.code slot-p +.code slotp function returns .code t if name @@ -34993,6 +34993,15 @@ 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 118 +The +.code slot-p +function's name changed to +.code slotp +after 118. The compatibility option causes +.code slot-p +to be defined also. + .IP 117 The arguments of the .code make-struct-type |