constantp([]) --> true and polynomialp([], [x]) --> true
Subject: constantp([]) --> true and polynomialp([], [x]) --> true
From: Robert Dodier
Date: Thu, 22 Aug 2013 17:25:57 +0000 (UTC)
On 2013-08-21, Barton Willis <willisb at unk.edu> wrote:
> Since constantp([]) is true, polynomialp([], [x]) is also true (by default,=
> polynomialp requires that polynomial coefficients satisfy constantp).
I dunno -- from the point of polynomialp, [] isn't all that different
from foo() or another no-arguments expression. What trouble does it
cause for polynomialp([], [x]) to return true?
> An expression is considered a constant expression if its arguments are=
> numbers ...
>
> Hum---the arguments of f(42) are numbers, but constantp(f(42)) isn't a cons=
> tant.
Pretty sure I wrote that documentation by reading the code and trying to
express it in words, but I misunderstood it, Actually an expression
is considered constant if (the operator has a simplification rule or is
declared constant), and its arguments are constants. I don't see a
motivation for that, but don't feel like arguing about changing it.
Maybe I'll try again to make the documentation match the code.
best
Robert Dodier