On Mon, Mar 09, 2026 at 03:03:54PM -0400, Camm Maguire wrote:
> Greetings!
>
> Yes, floating point exceptions are off by default in GCL, but can be
> enabled to taste:
>
>
> COMPILER>(si::break-on-floating-point-exceptions :floating-point-overflow t)
>
> (:FLOATING-POINT-OVERFLOW)
>
> COMPILER>(si::break-on-floating-point-exceptions :floating-point-overflow t)
>
> (:FLOATING-POINT-OVERFLOW)
>
> COMPILER>(si::break-on-floating-point-exceptions :floating-point-overflow nil)
>
> NIL
>
> COMPILER>(si::break-on-floating-point-exceptions :division-by-zero t)
>
> (:DIVISION-BY-ZERO)
>
> COMPILER>
>
> Please let me know if that clears it up or if problems persist.
>
> (GCL uses IEEE *hardware* floating point exceptions for this.
> Unfortunately, the trend among some newer cpu architectures, like arm
> and riscv64, deliberately do not support traps at this level....)
That solves problem for 2.7.1. With 2.6.14 and 2.15pre that I have
I still get errors, both in Lisp expample that I gave and in draw
command. Maybe my 2.15pre is too old.
BTW, there is also a different problem that I overlooked before.
Sequence of command:
x +-> if x < 0 then -x else x
abs1 := %
(x,y) +-> abs1(x) > abs1(y)
sort(%,[3,9,-4,10,-3,-1,-9,5])
produce no result and no error message. When I do
)lisp (si::use-fast-links nil)
)set break break
I get into GCL debugger:
Error:
Signalled by |*1;ANONYMOUSFUNCTION;1;FRAME0;INTERNAL|.
Condition in |*1;anonymousFunction;1;frame0;internal| [or a callee]: INTERNAL-SIMPLE-PROGRAM-ERROR: NIL [or a callee] requires more than zero arguments.
Broken at SYSTEM::BREAK-LEVEL. Type :H for Help.
1 Return to top level.
I get longish backtrace, shorthened it looks like:
#0 INVOKE-DEBUGGER {loc0=#<conditions::internal-simple-program-error.0>} [ihs=106]
#1 *1;anonymousFunction;1;frame0;internal {} [ihs=104]
#2 FN-GET {loc0=#<function 0000000001d04d70>,loc1=compiler::fun} [ihs=103]
#3 LOCAL-FUN-OBJ {loc0=#<function 0000000001d04d70>} [ihs=102]
#4 LOCAL-FUN-P {loc0=#<function 0000000001d04d70>} [ihs=101]
#5 COERCE-TO-FUNID {loc0=#<function 0000000001d04d70>} [ihs=100]
...
#60 T1EXPR {loc0=(defun |*2;anonymousFunction;0;frame0;internal| (#:g0 #:g1 |envArg|) ...)} [ihs=45]
#61 COMPILE-FILE1 {loc0=#P"/tmp/gazonk_3645744_0.lsp",loc1=#<@00000000035F5140>,loc2=#P"/tmp/gazon...} [ihs=44]
#62 COMPILE-FILE2 {loc0=#P"/tmp/gazonk_3645744_0.lsp",loc1=nil,loc2=nil,loc3=nil,loc4=nil} [ihs=43]
#63 COMPILE-FILE {loc0=#P"/tmp/gazonk_3645744_0.lsp",loc1=(t),loc2=(t t),loc3=(((style-warning . ...} [ihs=42]
#64 COMPILE {loc0=|*2;anonymousFunction;0;frame0;internal|,loc1=(nil),loc2=nil} [ihs=41]
#65 compile_defun {loc0=|*2;anonymousFunction;0;frame0;internal|,loc1=(defun |*2;anonymousFunction...} [ihs=40]
so the trouble is deep inside GCL COMPILE. AFAICS
"/tmp/gazonk_3645744_0.lsp" is empty. The function
'|*2;anonymousFunction;0;frame0;internal|' corresponds to FriCAS
code:
(x,y) +-> abs1(x) > abs1(y)
which gets translated to Lisp code:
(DEFUN
|*2;anonymousFunction;6;frame0;internal|
(#1=#:G2 #2=#:G3 |envArg|)
(>
(SPADCALL #1# '(#<function 0000000001d0f1e0>))
(SPADCALL #2# '(#<function 0000000001d0f6f0>))))
I see a little irreqularity, that is using sbcl I get new gensyms
on each run, using gcl I get the same name of gensyms (I do not
know if this matters). Otherwise the code look OK for me.
--
Waldek Hebisch