On 5/15/06, Barton Willis <willisb at unk.edu> wrote:
>
> The function rectform contains the logic that featurep( . , real) needs.
> Duplication is bad. Thus I'm leaning towards making
>
> featurep(e, real) := freeof(%i, rectform(e)).
Or, more simply, := is(equal(imagpart(e),0)). At some point, if efficiency
matters, I suppose we could rewrite risplit so that it doesn't return unused
components. Currently, realpart and imagpart generate the full rectform and
throw away the part they don't need.
By the way, featurep(,complex) is useless, always returning True (because
the reals are a subset), even for featurep(true,complex),
featurep(matrix([q]),complex), etc. The only way to see if something is
declared complex is not(featurep(x,real)).
Strange thing is, I think featurep started out originally simply as a way to
query the database, and not a way of determining the characteristics of
expressions. Here we see why it might be useful to keep those functions
distinct....
-s