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: Fri, 09 Feb 2024 08:43:11 +0200 Message-ID: <867cjew328.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5817"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 09 07:44:20 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 1rYKcV-0001KF-2N for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Feb 2024 07:44:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYKbg-0000nZ-Cn; Fri, 09 Feb 2024 01:43:29 -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 1rYKbZ-0000mq-HT for emacs-devel@gnu.org; Fri, 09 Feb 2024 01:43:23 -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 1rYKbZ-0002d6-3t for emacs-devel@gnu.org; Fri, 09 Feb 2024 01:43:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=sK228FR0r7hLVTDLkmtcvbz/DVNvxTQ1jkjXBDnUlek=; b=XKK9Vh3JesiI K5mW8jULYBcUpBrLjF5d4Pl5wP2NgqyS79MBBMk1iAZM8NuIdf9ekbwz4sQqDzaiDO6mVnpXcmaZh 2jSTLC2YIHa5BGspDtnpw6K+nxij6ot2TvcFdYaCMIsJ2vu0pKvA00NYkAwBWZBgFhiJS/k7EUnbF 6da8wL/N/R2VxRSWQolt6cgnprt3g/Rc5XabovIPwL6kSRh9hZf9OxwVX2Qvp4vYHyUDr4jKIENPQ 4iVfdtWuZjNyD6ujukNzHOqR/Zo/FNfbD4dWH0yk3eCC6PLKp8vzSEN7exsfD2BKvcy3aH3CsWoPw 7fmMFBZOPA50BdGe3/r6hA==; In-Reply-To: (message from Richard Stallman on Thu, 08 Feb 2024 22:49:26 -0500) 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:316064 Archived-At: > From: Richard Stallman > Date: Thu, 08 Feb 2024 22:49:26 -0500 > > As far as I can tell from the doc strings, the user level funcionality > of the two is the same. If there is a difference, I can't tell it from > those doc strings. But they compute values in different ways IIUC, the user-level functionality is not the same. 'cl-random' exposes the state of the RNG, whereas 'random' does not, and is based on RNG implementations that aren't required to support exposing the RNG state and setting it. > If there is a significant raal user-visible difference, would people please > describe it in the doc strings, so a user can decide which one to use? The doc string of 'cl-random' already says: Optional second arg STATE is a random-state object. We could add to 'cl-random's doc string the description of the algorithm it uses; however, doing the same for 'random' is not really possible because its RNG implementation is system-dependent.