aboutsummaryrefslogtreecommitdiff
path: root/doc/transpose.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-07 16:17:58 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-07-07 16:17:58 -0400
commit91b5abe9fa8b2394606f0eb82bfaeb54fa8a33e8 (patch)
tree26746a3f1c81874c8a65c705d19e6f13355f460c /doc/transpose.md
parent85c54f4c22897972025d76502b9e305541ec5a6e (diff)
Use # instead of ⍝ for comments
Diffstat (limited to 'doc/transpose.md')
-rw-r--r--doc/transpose.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/transpose.md b/doc/transpose.md
index e13b6691..006f0de6 100644
--- a/doc/transpose.md
+++ b/doc/transpose.md
@@ -69,7 +69,7 @@ Certainly not as concise as APL's version, but not a horror either. BQN's rule i
Axis permutations of the types we've shown generate the complete permutation group on any number of axes, so you could produce any transposition you want with the right sequence of monadic transpositions with Rank. However, this can be unintuitive and tedious. What if you want to transpose the first three axes, leaving the rest alone? With monadic Transpose you have to send some axes to the end, then bring them back to the beginning. For example [following four or five failed tries]:
- ≢ ⍉⁼⎉¯2 ⍉ a23456 ⍝ Restrict Transpose to the first three axes
+ ≢ ⍉⁼⎉¯2 ⍉ a23456 # Restrict Transpose to the first three axes
[ 3 4 2 5 6 ]
In a case like this BQN's Dyadic transpose is much easier.
@@ -80,7 +80,7 @@ Transpose also allows a left argument that specifies a permutation of the right
≢ 1‿3‿2‿0‿4 ⍉ a23456
[ 5 2 4 3 6 ]
- ≢ 1‿2‿2‿0‿0 ⍉ a23456 ⍝ Don't worry too much about this case though
+ ≢ 1‿2‿2‿0‿0 ⍉ a23456 # Don't worry too much about this case though
[ 5 2 3 ]
Since this kind of rearrangement can be counterintuitive, it's often easier to use `⍉⁼` when specifying all axes. If `p≡○≠≢a`, then we have `≢p⍉⁼a ←→ p⊏≢a`.
@@ -95,7 +95,7 @@ So far, all like APL. BQN makes one little extension, which is to allow only som
In particular, the case with only one argument specified is interesting. Here, the first axis ends up at the given location. This gives us a much better solution to the problem at the end of the last section.
- ≢ 2 ⍉ a23456 ⍝ Restrict Transpose to the first three axes
+ ≢ 2 ⍉ a23456 # Restrict Transpose to the first three axes
[ 3 4 2 5 6 ]
Finally, it's worth noting that, as monadic Transpose moves the first axis to the end, it's equivalent to dyadic Transpose with a "default" left argument: `(≠∘≢-1˜)⊸⍉`.