On Mon, Jul 20, 2026 at 07:37:40PM +0800, Qian Yun wrote:
> 1. in src/lisp/primitives.lisp, there's special case for
> versions earlier than ccl-1.8 (released in 2012),
> shall we still keep it or remove it? (Or ban it in
configure.ac.)
My policy is to avoid breakage when cost of compatibility is
reasonably low, as in this case.
> It is a bug to use "EQL" instead of "=" in |eql_DF|
> because it fails for 0.0d0 and -0.0d0.
Hmm, Hyper spec says about EQL:
: 2. If x and y are both numbers of the same type and the same value.
and about '='
: The value of = is true if all numbers are the same in value;
: otherwise it is false.
I read it that if numbers are of the same type, then both should
return the same result. But '=' may perform type convertions.
So in typed system EQL looks preferable.
But if for Lisp that implements EQL incorrectly (like CCL-1.8), using
'=' is reasonable.
> Also it affect my next point.
>
> 2. the implementation for sqrt/log/expt uses
> "checkComplex", which is not optimized, we can do better
> by checking if the argument is positive.
That did not show as a big thing when I tested speed, so
I did not look much at it. I guess that in old times
some Lisp functions due to roundoff produced complex
result even if argument was in the correct range.
Modern systems tend to be better in this aspect, so
probably we can relay on argument checks.
> I'd like to do the checking at lisp level but not
> repeat it twice for pre ccl-1.8.
Why at Lisp level? You can do this in Spad and efficiency
should be essentially the same.
> 3. for |abs_DF|, why use "FLOAT-SIGN" instead of "ABS",
> it felt strange to me.
Possibly cargo cult. But also 'FLOAT-SIGN' is specialized
while 'abs' is generic, which can make speed difference in
system with weak optimizer.
--
Waldek Hebisch