From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.devel Subject: Re: can `shuffle-vector' be moved? Date: Fri, 13 May 2011 10:03:57 +0800 Message-ID: References: <87pqnny9lk.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1305252261 24727 80.91.229.12 (13 May 2011 02:04:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 May 2011 02:04:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 13 04:04:18 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QKhjl-00021p-9j for ged-emacs-devel@m.gmane.org; Fri, 13 May 2011 04:04:17 +0200 Original-Received: from localhost ([::1]:50144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKhjk-0000jv-Ne for ged-emacs-devel@m.gmane.org; Thu, 12 May 2011 22:04:16 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKhji-0000jp-Em for emacs-devel@gnu.org; Thu, 12 May 2011 22:04:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKhjh-0000Mz-Ic for emacs-devel@gnu.org; Thu, 12 May 2011 22:04:14 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:33179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKhjh-0000Mu-9e for emacs-devel@gnu.org; Thu, 12 May 2011 22:04:13 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QKhje-00020E-CW for emacs-devel@gnu.org; Fri, 13 May 2011 04:04:10 +0200 Original-Received: from th041103.ip.tsinghua.edu.cn ([59.66.41.103]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 May 2011 04:04:10 +0200 Original-Received: from sdl.web by th041103.ip.tsinghua.edu.cn with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 May 2011 04:04:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: th041103.ip.tsinghua.edu.cn Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3.50 (Mac OS X 10.6.7) Cancel-Lock: sha1:uTVpocazYVwXm3eDG/XhjtoCwJE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139340 Archived-At: 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 Leo