Subject: Some documentation for kindp and featurep
From: Dieter Kaiser
Date: Mon, 11 May 2009 21:25:12 +0200
$featurep looks up the declarations of a symbol and has some more code to
determine if an expression is an integer, noninteger, odd, even or real. This
extra code causes an inconsistent behavior of $featurep.
I am wondering why we do not move this extra code to the appropriate user
functions: $integerp, $oddp, and $evenp. We do not have corresponding functions
for a noninteger and a real, but it might be useful to implement a complete set
of test functions.
A look in the code (core and share) shows that $featurep is mostly used with
$integer, $odd, $even, which uses the extra code, and only in one place with
$imaginary.
I have tried the change and have got no problems with the testsuite and the
share_testsuite.
This topic was already discussed in the closed bug report "oddp and evenp in
functs.mac broken - ID: 866075". I have not found any further discussion on the
mailing list.
So, perhaps it is better to have Maxima user functions $integerp, $oddp, $evenp,
... which not only work for numbers, but for symbols and expressions too and let
$featurep look up only declarations of symbols.
Dieter Kaiser