Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I assume the built-in definition you're referring to is pmat. That illustrates how to solve your problem near the bottom. The idea is simply if σ is a permutation of length N and A is an array of l...
#1: Initial revision
I assume the built-in definition you're referring to is [pmat](https://dfns.dyalog.com/n_pmat.htm). That illustrates how to solve your problem near the bottom. The idea is simply if σ is a permutation of length N and A is an array of length N, then A[σ] is A permuted by σ. This leads to a definition like:
```apl
permute←{⍵[pmat⊃⍴⍵]}
```
with
```apl
permute 'abc'
```
producing
```
abc
acb
bac
bca
cab
cba
```
(The example in the documentation uses `{⍵[pmat⍴⍵]}` but this seemed to lead to rank errors when I tried it in online interpreters using one of the definitions of `pmat` listed on that page.)
