The CLJS version of shuffle accepts arrays, but the CLJ version does not.
The CLJS version of shuffle accepts nil, but the CLJ version does not.
This behavior could be unified.
Proposal:
- Add support for arrays in CLJ
- Add support for nil in CLJ and return nil or ().
- The behavior of the CLJS version on nil should be made the same as CLJ: do not return an empty vector, since nil does not pun as an empty vector.
- The CLJS version supports a shuffle of string, but this can be considered undefined behavior.
The attached patch CLJ-2470 adds support for nil (also returns nil) and Java arrays.
Patch CLJ-2470-2 adds a better error message.
Patch: CLJ-2470-2.patch
Prescreened by: Alex Miller