From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: random doesn't feel very random Date: Mon, 27 Aug 2012 00:48:47 -0400 Message-ID: References: <876288yh72.fsf@kanis.fr> <87wr0livd4.fsf@Rainer.invalid> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1346042949 10482 80.91.229.3 (27 Aug 2012 04:49:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Aug 2012 04:49:09 +0000 (UTC) Cc: Achim Gratz , emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 27 06:49:09 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T5rG8-0006E9-5Y for ged-emacs-devel@m.gmane.org; Mon, 27 Aug 2012 06:49:08 +0200 Original-Received: from localhost ([::1]:49453 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5rG6-00008X-75 for ged-emacs-devel@m.gmane.org; Mon, 27 Aug 2012 00:49:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5rG4-00008N-AD for emacs-devel@gnu.org; Mon, 27 Aug 2012 00:49:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T5rG3-00070W-Cp for emacs-devel@gnu.org; Mon, 27 Aug 2012 00:49:04 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:20621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5rG3-00070Q-8i; Mon, 27 Aug 2012 00:49:03 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu0/O+KG6/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLNBIUGA2IQAW6CY0mgx4DozOBWIMF X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="196772148" Original-Received: from 206-248-161-186.dsl.teksavvy.com (HELO pastel.home) ([206.248.161.186]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Aug 2012 00:48:58 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 8DEDB59401; Mon, 27 Aug 2012 00:48:47 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Sun, 26 Aug 2012 23:41:13 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:152858 Archived-At: > It is a feature that, if you don't call (random t), `random' returns > a predictable sequence. That is good for debugging. I wonder how often this has been useful. Since most/any package that uses `random' will want the sequence to be unpredictable, many packages call (random t) at various times, so before you can benefit from such a feature, you'll need to disable those (random t) that would otherwise get in the way. It would be much simpler to always seed the PRNG at startup from "unpredictable" data and then provide a (random-seed N) which you can call explicitly to reset the PRNG to a predictable state if/when you need it for debugging. > Perhaps we should create a different interface for that feature > and make the default truly random. Exactly (for some value of "truly random"). Stefan