From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17944 invoked from network); 11 Oct 2022 12:37:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2022 12:37:13 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665491834; b=G6EAzvXO/mUS9E8wu7H+lbpE7l2V4kSsZQbOS0hhApGQepxEk1NaNmLvL+6g+SPSYbL8jyaKhd R3MkWuRemlKqkIfMzJbp88OauLYVpA/DZoQKEvoESrvipysf6ambvW7XUek3dBOsK9wpA403qP 4WIDAMSuXWJwc4Lha7kJ3WAd30JuMmuX1T8sIjGSJs1KVR7PO+LiggozePOPKRoO5Ml03CSdnt aK9XU7Okutbfld8udqi+Q2FYOiOmDOJ8DZZRKssu8rhkx6Q94RDcZlF+ONRnmNDpc5qA4wFtl9 2Rv/J/nyCZyZycWAIm7ha2L4eiIAciKDxbcAg2fFJR2GMQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1665491834; bh=AiLqcWAjvC6VIYA4MzsuKE4extan8fpznheluJjFjEo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=dgCkox4OsRmD1JqVsDx0mGfBUcEGCIKShNl0ihZgJWraTV9OBtn3dMYGjQcvL+kIu/awy6oOc+ WeGsnEvSWSe7pGQi1C2Nsg1go+h147r8MfOQR5MLarteA1L4FqbYN7v70RWMb630n5/rFHwL5C 6wg9RsAzDs1MxZydh//+Z5UKzuctc+pAqod+Nij/Fno6QWEYNe8GqVdWUHYejGR3sfU5dA/y99 4OyBX42PH/JH0kUBpPDxF6yfgeF2jYk8kfezQQR1Rd3dCMJ4+zaMa2OWkw4YIYufxEnKvF8BDE ExqEtVlD3INclYN9gLesaoUZDfB7OnHR+YClC+5VsQqgUg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=qnAxFo/BWpKuFxus59y4lBsQvh/d9jSyEUp5WxGghmQ=; b=WHlNNzl8ErMLp64AE1y3GodLWF smfYu3A9+JOQMxnSrlIX/44lgKQXrl9A2gjX9EvaSZshnwtbrL2IzZXYdx+65u3WvQnhubtYGWUTH la/Z/6PM8LIg8rooXS2Y1ABnKY2bE8q4Jp4P1Y2fkICXRa4x6kPdYwCSaCaSiKgN9+fkacEY1AyxK 1nW5JLMiLaT0nLra5YzuAEuu0L4zInXUr1LoHrCGffyp67loRb9hDYoFprfGsi4CpzAdAaR9AuCub ZN6d68G//zrx8RVytNLOhW1aHtRD5njuKd/4Xx+Uo2RkLZ6PJg5FBsRtVga6NVJSSc835dwRoN7vC 2yuqGBcg==; Received: by zero.zsh.org with local id 1oiEVU-000BNS-T1; Tue, 11 Oct 2022 12:37:12 +0000 Authentication-Results: zsh.org; iprev=pass (iris.zentaur.org) smtp.remote-ip=198.58.127.206; dkim=pass header.d=zentaur.org header.s=dkim20200120 header.a=rsa-sha256; dmarc=pass header.from=zentaur.org; arc=none Received: from iris.zentaur.org ([198.58.127.206]:40664) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1oiETt-000B2a-Tu; Tue, 11 Oct 2022 12:35:34 +0000 Received: from iris.zentaur.org (localhost [127.0.0.1]) by iris.zentaur.org (Postfix) with ESMTP id 4MmwH836rqz3wZj for ; Tue, 11 Oct 2022 12:35:32 +0000 (UTC) Authentication-Results: iris.zentaur.org (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=zentaur.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zentaur.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:references:to:content-language:subject:subject :user-agent:mime-version:date:date:message-id; s=dkim20200120; t=1665491731; x=1665495332; bh=AiLqcWAjvC6VIYA4MzsuKE4extan8fpz nheluJjFjEo=; b=zAGFs4Ufa5IJFkCTcNn1tygAP5q5ILY4Gv5wmW8fUCcpUm4O ig5eaH5BUDJsoRzmySF8AQerQGCwOv6YxYl2cpff8GoXiOZfEfeXX42pFeSTiGl1 iQoBvda/KxXdiqbDGTmbVI1ZFaYc/jqPqFKf3lZNxjSFmrA7l09jx6toKDG2fxSZ W9fchTlZT+wTuotI0ZgbbhcKllvvaEOMSAQoNqW31MOw7BEkaSeOkc9rwRy4G9a4 UfNon22lrpyMHyB9KhE3FM7jP0dLkfV15PoMS3cFIQrYrQIApaogqNR/F30msV/1 S2Lo94vg6/Ut9qlyOZcxLeHsT8E5bikLK0KvkQ== X-Virus-Scanned: amavisd-new at iris.zentaur.org Received: from iris.zentaur.org ([127.0.0.1]) by iris.zentaur.org (iris.zentaur.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rB3nwEUEYQlP for ; Tue, 11 Oct 2022 12:35:31 +0000 (UTC) Received: from [192.168.72.136] (unknown [136.50.213.220]) by iris.zentaur.org (Postfix) with ESMTPSA id 4MmwH74rCRz3wZb for ; Tue, 11 Oct 2022 12:35:31 +0000 (UTC) Message-ID: <8918db54-3687-b26e-4a04-1a8814b11f86@zentaur.org> Date: Tue, 11 Oct 2022 07:35:31 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: use of rand() in zsh Content-Language: en-US To: zsh-workers@zsh.org References: From: Clinton Bunch In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: Avast (VPS 221010-10, 10/10/2022), Outbound message X-Antivirus-Status: Clean X-Seq: 50778 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On 10/10/2022 8:14 PM, Bart Schaefer wrote: > On Mon, Oct 10, 2022 at 4:38 PM Clinton Bunch wrote: >> Is there a reason that zsh goes out of the way (srand_deterministic) to >> use the least random "random" function on modern Unix? > The values of RANDOM form an intentionally-repeatable pseudo-random > sequence; subshells that reference RANDOM will result in identical > pseudo-random values unless the value of RANDOM is referenced or > seeded in the parent shell in between subshell invocations. > > This is e.g. so you aren't surprised by referencing $RANDOM inside > $(...) and getting a different result. > Doesn't zsleep_random's use of rand() break this predictability, or have I just not studied the use of zsleep_random enough?