all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: can `shuffle-vector' be moved?
Date: Fri, 13 May 2011 00:00:53 -0600	[thread overview]
Message-ID: <iqihdr$gnk$1@dough.gmane.org> (raw)
In-Reply-To: <87fwojw91r.fsf@lifelogs.com>

On 5/12/11 9:53 PM, Ted Zlatanov wrote:
> On Fri, 13 May 2011 10:03:57 +0800 Leo<sdl.web@gmail.com>  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.

 From cl-macs.el:

;; These are extensions to Emacs Lisp that provide a degree of
;; Common Lisp compatibility, beyond what is already built-in
;; in Emacs Lisp.
...
;; This file contains the portions of the Common Lisp extensions
;; package which should be autoloaded, but need only be present
;; if the compiler or interpreter is used---this file is not
;; necessary for executing compiled code.

-- 
Kevin Rodgers
Denver, Colorado, USA




  reply	other threads:[~2011-05-13  6:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-12 19:58 can `shuffle-vector' be moved? Ted Zlatanov
2011-05-13  2:03 ` Leo
2011-05-13  2:10   ` Stefan Monnier
2011-05-13  3:49     ` Ted Zlatanov
2011-05-13 13:57       ` Stefan Monnier
2011-05-13  3:53   ` Ted Zlatanov
2011-05-13  6:00     ` Kevin Rodgers [this message]
2011-05-13 14:48       ` Ted Zlatanov
2011-05-13 15:26         ` Stefan Monnier
2011-05-13 16:22           ` Ted Zlatanov
2011-05-13 16:47             ` Stefan Monnier
2011-05-13 16:51               ` Ted Zlatanov
2011-05-13  6:19 ` Thierry Volpiatto
2011-05-13 14:00   ` Stefan Monnier
2011-05-13 14:38     ` Ted Zlatanov
2011-05-13 17:13     ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='iqihdr$gnk$1@dough.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.