hermann on Fri, 22 May 2026 18:03:04 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: question on collecting t_MAT


On 2026-05-22 14:58, Bill Allombert wrote:

Maybe I should allow
? [type(A)|e<-[1,2];A=matrix(2,2,x,y,e)]

Cheers,
Bill

If it is not only for type, that what be wonderful.

The first 9 assignments below have to be <-[...] because of selection from list.
But if "A=[a11,a12,a13;a21,a22,a23;a31,a32,a33]" would work
instead of workaround below that would increase readability:

  Ms=[A|a11<-S;a12<-S;a13<-S;
        a21<-S;a22<-S;a23<-S;
        a31<-S;a32<-S;a33<-S;
        A<-[[a11,a12,a13;a21,a22,a23;a31,a32,a33]],
        matdet(A)^2==1 && no0(A^-1)
     ];

But allow that only if you do not have to change the compiler too much
(I worked as Compiler Level3 support engineer at IBM the last 18 years before early retirement last year).

Regards,

Hermann.

P.S:
Another "issue" I found is that with "A=matrix(3,3);" before above command
"A[1,1]<-S" instead of "a11<-S" errors out:

*** variable name expected: Ms=[A|A[1,1]<-S;a12<-S;a13<-S;a21<-S;a22<-S;a2 *** ^----------------------------------------


This would be even better readable if it would work:

{
  A=matrix(3,3);
  Ms=[A|A[1,1]<-S;A[1,2]<-S;A[1,3]<-S;
        A[2,1]<-S;A[2,2]<-S;A[2,3]<-S;
        A[3,1]<-S;A[3,2]<-S;A[3,3]<-S,
        matdet(A)^2==1
     ];
}