Qian Yun
unread,Apr 16, 2026, 11:32:24 PM (4 hours ago) Apr 16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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