Modify ROTATE/SHUFFLE and add NROTATE/NSHUFFLE
The current manual for
Note: the original sequence may be destructively altered, and result sequence may share structure with it.
This is inconsistent with the naming scheme for destructive operations in Common Lisp, which are commonly prefixed with
n. This also means that Alexandria does not export a non-destructive sequence-rotating operation.
Move the current
nrotate and export that new symbol.
rotate may then be implemented by means of calling
copy-sequence to always work on fresh data.
Cost to users
- User code may need to be modified to avoid double copying that results in effect of this change.
- Possible, but unlikely, package conflicts if another package used next to Alexandria exports a
- Possible breakage of user code if
rotatewas used only for its side effects and not for its return-value.
Benefits to users
- Better separation of mutating from non-mutating operations by using the
nprefix for mutating operations, just like with
- Exporting a non-destructive functionality that performs the same operation as the new
nrotatewithout mutating original data.
- The change is backwards-compatible protocol-wise if the return value of