summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/txr/stdlib/struct.tl2
-rw-r--r--struct.c8
-rw-r--r--struct.h2
-rw-r--r--txr.115
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)
diff --git a/struct.c b/struct.c
index 1456b3b1..0a38677a 100644
--- a/struct.c
+++ b/struct.c
@@ -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));
diff --git a/struct.h b/struct.h
index 612c47db..bb48a2b3 100644
--- a/struct.h
+++ b/struct.h
@@ -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);
diff --git a/txr.1 b/txr.1
index a28bc02a..b727b75c 100644
--- a/txr.1
+++ b/txr.1
@@ -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