From ab59762e97c7f68f271fde7401d93c26bbbe7d6d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 26 Mar 2023 16:37:54 -0700 Subject: New function: arithp. * lib.h (arithp): Declared. (plus_s): Existing symbol declared. * arith.c (arithp): New function. * struct.h (special_slot): New enum member plus_m. * struct.c (special_sym): Register plus_s together as the [plus_m] entry of the array. * tests/016/arith.tl * tests/016/ud-arith.tl: Tests for arithp. * txr.1: Documented. * stdlib/doc-syms.tl: Updated. --- txr.1 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index f580ed8c..f7680b13 100644 --- a/txr.1 +++ b/txr.1 @@ -48806,6 +48806,28 @@ a or .codn float . +.coNP Function @ arithp +.synb +.mets (arithp << object ) +.syne +.desc +The +.code arithp +function returns true if +.met object +is a character, integer, floating-point number, range or a user-defined arithmetic object. +For a range, +.code t +is returned without examining the values of the +.code from +and +.code to +fields. +A user-defined arithmetic object is identified as a struct type which +implements the +.code + +method as a static slot. + .coNP Functions @ zerop and @ nzerop .synb .mets (zerop << number ) -- cgit v1.2.3