This was part of a larger program and a lot of bits and pieaces had to be 
removed
and simplified in order to pin down the error.

However, instead of a local var, if T is declared as a global var it runs 
ok again:


TT.input:


F := PF 5

T : Matrix F

(B1, B2, B3) : Vector F

SetVecs() ==
   free B1, B2, B3
   B1 := [1, 2, 3]
   B2 := [2, 3, 1]
   B3 := [3, 1, 2]
   output("")

GetMatx() ==
   free B1, B2, B3, T
   T := matrix [B1, B2, B3]
   (output("T:", T); output(""))
   (output("Rank:", rank(T)); output(""))

SetVecs()
GetMatx()



(1) -> )r TT
F := PF 5


   (1)  PrimeField(5)

T : Matrix F


(B1, B2, B3) : Vector F


SetVecs() ==
   free B1, B2, B3
   B1 := [1, 2, 3]
   B2 := [2, 3, 1]
   B3 := [3, 1, 2]
   output("")


GetMatx() ==
   free B1, B2, B3, T
   T := matrix [B1, B2, B3]
   (output("T:", T); output(""))
   (output("Rank:", rank(T)); output(""))


SetVecs()

   Compiling function SetVecs with type () -> Void

GetMatx()

   Compiling function GetMatx with type () -> Void
      ┌1  2  3┐
      │           │
   T: | 2  3  1 │
      │           │
      └3  1  2┘

   Rank: 3

(8) ->


It seems the compiler only has issues with the local declaration of T.

Sid

On Monday, December 8, 2025 at 10:54:48 AM UTC-6 [email protected] wrote:

> > GetMatx() ==
> > free B1, B2, B3
> > T : Matrix F
> > T := matrix [B1, B2, B3]
> > (output("T:", T); output(""))
> > (output("Rank:", rank(T)); output(""))
> Compile-time error:
> COMMON-LISP:T names a defined constant, and cannot be used in LET.
>
> > That seems a little strange....
>
> Indeed.
>
> Obvooiously, the interpreter does not properly choos a new name for T. 
> It cannot map it directly to T in lisp, since in Lisp it simply 
> represents the true value and not a variable.
>
> That's certainly a bug, but why do you make your input so complicated?
> The following also works (even with T as variable).
>
> F := PF 5
> T: Matrix F := matrix([_
> [1, 2, 3],_
> [2, 3, 1],_
> [3, 1, 2]]);
>
> output("T:", T); output(""); output("Rank:", rank(T))
>
> Raf
>

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/6a11e3af-0045-41d8-a77c-93f5320f2c5bn%40googlegroups.com.

Reply via email to