Matrix transposition: Difference between revisions

Content added Content deleted
mNo edit summary
Line 2,532: Line 2,532:
=={{header|Joy}}==
=={{header|Joy}}==
For matrices represented as lists, there's ''transpose'', defined in seqlib like this:
For matrices represented as lists, there's ''transpose'', defined in seqlib like this:
<lang joy>DEFINE transpose == [ [null] [true] [[null] some] ifte ]
<syntaxhighlight lang=Joy>DEFINE transpose == [[null] [true] [[null] some] ifte]
[ pop [] ]
[pop []]
[ [[first] map] [[rest] map] cleave ]
[[[first] map] [[rest] map] cleave]
[ cons ]
[cons]
linrec .</lang>
linrec.</syntaxhighlight>


=={{header|jq}}==
=={{header|jq}}==