regression in commit 4c6f3d9a Replace '(Zero) and '(One) by ["0"] and ["1"]

1 view
Skip to first unread message

Qian Yun

unread,
Apr 13, 2026, 5:18:48 AM (4 days ago) Apr 13
to fricas-devel
After this commit, infinite recursion will happen if you
ask for 0 or 1 in a Domain that doesn't have them:

(1) -> 1$INT

(1) 1
Type: Integer
(2) -> 1$LIST INT
^C
>> System error:
Interactive interrupt at #xB80000C377.
......
Backtrace for: #<SB-THREAD:THREAD tid=1231153 "main thread" RUNNING
{1200038003}>
0: (LASSOC |1| #<unavailable argument>)
1: (|constantInDomain?| (|1|) (|List| (|Integer|)))
2: (|upDollar| (|List| (|Integer|)))



diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot
index 091cbe29..0f5e21a6 100644
--- a/src/interp/i-coerce.boot
+++ b/src/interp/i-coerce.boot
@@ -332,8 +332,8 @@ constantInDomain?(form,domainForm) ==
key := opOf form
entryList := LASSOC(key,opAlist)
entryList is [[., ., ., type]] and type in '(CONST ASCONST) => true
- key = "One" => constantInDomain?(["1"], domainForm)
- key = "Zero" => constantInDomain?(["0"], domainForm)
+ key = "1" => constantInDomain?(["1"], domainForm)
+ key = "0" => constantInDomain?(["0"], domainForm)
false

Similar situation goes for "getConstantFromDomain1".

- Qian

Reply all
Reply to author
Forward
0 new messages