On Fri, 13 May 2011 10:03:57 +0800 Leo<address@hidden> wrote:
L> On 2011-05-13 03:58 +0800, Ted Zlatanov wrote:
Also this loop call from Pascal Bourguignon is a nice CL alternative to
`shuffle-vector', though it uses the same algorithm:
(defun shuffle (vector)
"Re-orders randomly the vector."
(loop
for i from (1- (length vector)) downto 1
do (rotatef (aref vector i) (aref vector (random i)))))
Can it go into cl-macs.el?
L> We should have one version and not in cl-macs.el.
Why? There are many functions in cl-macs.el that have analogues in
plain ELisp. If anything I would drop `shuffle-vector' :)
L> `shuffle' is not in common lisp.
I didn't say it was. cl-macs.el is not Common Lisp by any means and IMO
should not be treated as a clone of it.