From f43fda4e635370689fc248bb7e94e5861151df2c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 9 Jul 2021 08:21:15 -0700 Subject: defstruct: diagnose built-in type being redefined. * eval.c (eval_init): Register built-in-type-p intrinsic. * lib.c (buitin_type_p): Rename to built_in_type_p since the word built-in is hyphenated. The function also tests whether the argument is a COBJ class. (cobj_class_exists): Function removed. * stdlib/doc-syms.tl: Updated. * stdlib/struct.tl (defstruct): Add built-in-type-p check. * struct.c (make_struct_type): Call only built_in_type_p; cobj_class_exists is gone. * txr.1: Document built-in-type-p. --- txr.1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index c36be80c..47d41801 100644 --- a/txr.1 +++ b/txr.1 @@ -19284,6 +19284,21 @@ always matches. If such a clause is placed as the last clause of a it provides a fallback case, whose forms are evaluated if none of the previous clauses match. +.coNP Function @ built-in-type-p +.synb +.mets (built-in-type-p << object ) +.syne +.desc +The +.code built-in-type-p +function returns +.code t +if +.meta object +is a symbol which is the name of a built-in type. +For all other objects it returns +.codn nil . + .SS* Object Equivalence .coNP Functions @, identity @ identity* and @ use -- cgit v1.2.3