Clamps Dictionary
permute
Function
(permute list permutation)
Return a permutation of list according to the indexes in permutation.
Arguments
list |
List of elements to be permuted. |
permutation |
List of permutation indexes. |
Examples
(permute '(1 2 3 4 5) '(3 1 4 2 0)) ; => (4 2 5 3 1)
Note
For a valid permutation the permutation index list should contain all integer indexes of list starting from zero. In that case, length of list is equal to the length of permutation. If it is shorter, an error occurs, if it is longer, not all elements of list are returned.
Created: 2025-02-18 Di 12:58