[PATCH] fix regression in 962d0974 convert_params in alql.spad

1 view
Skip to first unread message

Qian Yun

unread,
Apr 16, 2026, 11:32:24 PM (4 hours ago) Apr 16
to fricas-devel
diff --git a/src/algebra/alql.spad b/src/algebra/alql.spad
index 0809fa27..3ff377c3 100644
--- a/src/algebra/alql.spad
+++ b/src/algebra/alql.spad
@@ -92,16 +92,25 @@ IndexCard() : Exports == Implementation where
symbol?(os) => string(symbol(os))
""

+ convert_params(params : List(SE)) : String ==
+ empty?(params) => ""
+ rl : List(String) := ["("]
+ first := true
+ for a1 in params repeat
+ if not(first) then
+ rl := cons(", ", rl)
+ rl := cons(string(symbol(a1)), rl)
+ rl := cons(")", rl)
+ concat(reverse!(rl))
+

(Disclaimer: this issue is found by LLM, but the analysis and patch
is thoroughly reviewed by me.)

In this loop, "first" in never set to "false",
causing no "," separation between parameters.

Reproducer for this bug:

[x.params for x in (getDatabase "p" pretend List ICARD)]

(was: "(R,ls,ls2)", now: "(Rlsls2)", after patch: "(R, ls, ls2)")

Patch to fix this:

diff --git a/src/algebra/alql.spad b/src/algebra/alql.spad
index 3ff377c3..c8305e06 100644
--- a/src/algebra/alql.spad
+++ b/src/algebra/alql.spad
@@ -99,6 +99,7 @@ IndexCard() : Exports == Implementation where
for a1 in params repeat
if not(first) then
rl := cons(", ", rl)
+ first := false
rl := cons(string(symbol(a1)), rl)
rl := cons(")", rl)
concat(reverse!(rl))

- Qian

Waldek Hebisch

unread,
Apr 16, 2026, 11:42:08 PM (4 hours ago) Apr 16
to fricas...@googlegroups.com
Thanks, please commit.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages