From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Why have both `random' and `cl-random'? Date: Sat, 10 Feb 2024 17:40:58 +0200 Message-ID: <86o7cotjhx.fsf@gnu.org> References: <86y1bsu0s4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15896"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, emacs-devel@gnu.org To: "Alfred M. Szmidt" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Feb 10 16:41:54 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rYpUG-0003vY-Jp for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Feb 2024 16:41:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYpTY-0007Vw-IW; Sat, 10 Feb 2024 10:41:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYpTX-0007VY-Ad for emacs-devel@gnu.org; Sat, 10 Feb 2024 10:41:07 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYpTX-0003Lc-1r for emacs-devel@gnu.org; Sat, 10 Feb 2024 10:41:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=t7WStQBU26oWJQGTXWt8kgHaieKsVaS3uqJ+I5/IL6s=; b=d5DiJCuBy1Bp23aBSRck U5mlopqbC4Kpjr3GsOQY5FwN7yx7GVr4++EPsoKCNZWaaOltW11mL3Xh+rek0DOUDJfzC0UMgmga9 laxmBIJ8eq8+ji4C/9JY9XmZ8Dv8xP2l2spqrel5uU95hdfF0q41giT1QTNllQTR4LEu8pvEa1v+5 ioQ5QsxQdaohalRFkgapyvwbtokoArsZhXOZEkNs+J0rrcc2RYGmIDQHUEO4Ko58WOJBAVbIxYNQq EMiq4UNtjM86fMgH4HKmC77b75VSWrURmXITzoLh6iWHywWo+r9QScbvT9pM1eGYOiBfV7RG2pgbV WuW2g0qbFyOi5g==; In-Reply-To: (ams@gnu.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316096 Archived-At: > From: "Alfred M. Szmidt" > Cc: rms@gnu.org, emacs-devel@gnu.org > Date: Sat, 10 Feb 2024 10:00:39 -0500 > > (random &optional LIMIT) > > Return a pseudo-random integer. > By default, return a fixnum; all fixnums are equally likely. > With positive integer LIMIT, return random integer in interval [0,LIMIT). > With argument t, set the random number seed from the system’s entropy > pool if available, otherwise from less-random volatile data such as the time. > With a string argument, set the seed based on the string’s contents. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Missed that, but doesn't that mean that using a limit _and_ a seed is > not possible? I think the idea in that case is that you first call random with a seed (and ignore the value), and then continue calling it with a limit. But I didn't try that, so maybe I'm missing something.