unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: Add seq-random-elt
Date: Sat, 22 Oct 2016 08:42:46 -0400	[thread overview]
Message-ID: <87bmyc8shl.fsf@lifelogs.com> (raw)
In-Reply-To: jwvshrpie92.fsf-monnier+gmane.emacs.devel@gnu.org

On Fri, 21 Oct 2016 17:30:02 -0400 Stefan Monnier <monnier@iro.umontreal.ca> wrote: 

>>> Hmm... do we really need that?  What's the benefit?
>> I think it's convenient.  Accessing random elements of sequences is not
>> uncommon.

SM>     (seq-elt L (random (seq-length L)))

SM> it pretty convenient to write and pretty clear as well, so the benefit
SM> seems slim.

I don't like to name variables twice. I've sometimes forgotten to change
the second place when I copy and paste, creating very annoying bugs.

I also think this would be helpful to beginners who may not intuit the
right approach so easily.

Ted




  parent reply	other threads:[~2016-10-22 12:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21  6:05 Add seq-random-elt Damien Cassou
2016-10-21  8:08 ` Nicolas Petton
2016-10-21  9:06 ` Nicolas Petton
2016-10-21 18:57 ` Stefan Monnier
2016-10-21 20:52   ` Nicolas Petton
2016-10-21 21:30     ` Stefan Monnier
2016-10-22  8:13       ` Michael Heerdegen
2016-10-22 12:42       ` Ted Zlatanov [this message]
2016-10-22 14:53       ` Clément Pit--Claudel
2016-10-22 14:54 ` Clément Pit--Claudel
2016-10-23 17:06 ` Damien Cassou
2016-10-24 11:03   ` Nicolas Petton
2016-10-24 13:07     ` Stefan Monnier
2016-10-24 16:24   ` Davis Herring
2016-10-24 16:54     ` Clément Pit--Claudel
2016-10-25  6:52 ` Damien Cassou
2016-10-25 10:33   ` Nicolas Petton
2016-10-25 18:58     ` Eli Zaretskii
2016-10-25 19:32       ` Nicolas Petton

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87bmyc8shl.fsf@lifelogs.com \
    --to=tzz@lifelogs.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).