[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can `shuffle-vector' be moved?

From: Leo
Subject: Re: can `shuffle-vector' be moved?
Date: Fri, 13 May 2011 10:03:57 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.7)

On 2011-05-13 03:58 +0800, Ted Zlatanov wrote:
> I don't know where it should live, but cookie1.el doesn't seem like the
> right place.
> It should be documented in "(elisp) Vector Functions" as well.
> Let me know if I should do this, please.
> 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?

We should have one version and not in cl-macs.el. `shuffle' is not in
common lisp.

> Thanks
> Ted


reply via email to

[Prev in Thread] Current Thread [Next in Thread]