ktye / i

interpret
100 stars 16 forks source link

angle function #39

Closed TheFausap closed 1 year ago

TheFausap commented 1 year ago

Hello, I am trying to define a phase matrix, dependent by a parameter. I defined this function:

P:{t:angle[1;x];(1 0;0 t)}

but if I run P 45, I receive this error:

P:{t:angle[1;x];(1 0;0 t)}
                       ^

even if I do not use the temp var, by defining:

P:{(1 0;0 angle[1;x])}

I receive another error:

P:{(1 0;0 angle[1;x])}
              ^

Do you have any idea why that is?

thanks, Fausto

ktye commented 1 year ago

in k you cannot define a matrix as (1 0;0 t) this notation (to form a vector) is only allowed for numbers. 0 t means index 0 with t (same as 0@t or 0[t]). you have to write (0;t). if they are the same type, they are collapsed to a unitype vector, otherwise they remain a general list.

TheFausap commented 1 year ago

thanks! with ; it works as intended :)