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=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3743 invoked from network); 11 Oct 2022 14:49:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2022 14:49:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665499752; b=iTr/7vaAmt5iC0lA1gryDvZMc4dRZN9GJkQynsUF+0uzdsoBvSrarx6ijbFlDnq38uc6zbQ5Zd XtIa7s2QiBLQhrOvReFqEN4wU/RrMb1jHL5uEpaZw+S3soZfb4ou+H/sRdtwfCaWiXS1sng5o2 N01R1ABNqr7Jg/WdkCripVpZ6pqR1G1yWBg9Fc3VVFGw8g0SUrYZOMJUk3Z/yn+jC5LBwzy9Ox ox8yL8BtAracOaIYLqCgYptGAhqm2lj2lHXKeHkb1xMxnrzWFJtZFHz4hU9Lg8t4wDXn75X0jl 2vGx6bepKY8++OF1DLGPMeen8lc32UJPMMK9pGLjhhY7vw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1665499752; bh=jUKefJ7nD8jTSogSxkBbpl1KLj9P9h9qX9lLjp/WBWA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=m4kwbjxnDAUmRwgBNT3xh+GRRS3uwis6Sm/+Fp2L2d3uze/ELlviWX6ya1JFnAWQmESgQk7eQ1 28KvIXWDHfb9DnMnoL5xkCvFzsNtwjTmoXLYCRP37gzAM3ftovhA6tjoxb0LbIjsiTIeqPLTKf FueyDliu4FQljIO+ZpIOgANw7mHK04UK8CHR3q/vhs+lxqZ7j/bK4flMVhWuAXb51rv7mbeplp nVJYISURyR4NmTlvTkroBbMXGUHkGixMEwILeaXaqjUMRNEpxD1xAE9j4QRpndoupDmaEGCi29 vpp4qiJ8sjVO+d/XNiJ4sHt79/yIDUUcAsVr0Cc5A+7Ggw==; 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:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=RWdj6BFsyjCt2AX/BUeXjGt8BGcgFsAo+Jhv68wLmys=; b=MCOrfGxCEcK66pK1EDKhBluFwy 9XbUieG1Ro6VqYEhFuxeoCbFIGnSg8BurCTZnu7JrrSkQa3xeFC7NRC+60/jbxOcXPuJaDx9Hfvss Pz/LmIeY/vrBJKoVuRf4gwgMv1eaA86BHTP1Ge7HrrNrruw/He+XteG1zPUF7mNaom7ijcqTnb2xO 2v7TE24i77KAe3bJj93/htx1D3JwFq8UOsqZQm72uK3uFD6rLUlRxUIy2rUjc+wjpMKuEowdRyzet 8eHfyOb/WWrsqqgIXciPDojU3FsVF25bKajghMtiksabf6QTo8osDNJQMq5E1vJPgyGDocN0v4079 okvDNisg==; Received: by zero.zsh.org with local id 1oiGZE-000HGZ-9b; Tue, 11 Oct 2022 14:49:12 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq1.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.96; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq1.tb.ukmail.iss.as9143.net ([212.54.57.96]:42512) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1oiGYf-000Gw2-A7; Tue, 11 Oct 2022 14:48:39 +0000 Received: from [212.54.57.81] (helo=smtp2.tb.ukmail.iss.as9143.net) by smtpq1.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1oiGYe-0004OR-T8 for zsh-workers@zsh.org; Tue, 11 Oct 2022 16:48:37 +0200 Received: from oxbe7.tb.ukmail.iss.as9143.net ([172.25.160.138]) by smtp2.tb.ukmail.iss.as9143.net with ESMTP id iGYeoqjndmIDmiGYeopBdw; Tue, 11 Oct 2022 16:48:36 +0200 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.138 X-CNFS-Analysis: v=2.4 cv=LoCBd1Rc c=1 sm=1 tr=0 ts=63458244 cx=a_exe a=fsVlV1GYKS3C/xnq+HX56g==:117 a=1DWFKdCB1IcA:10 a=IkcTkHD0fZMA:10 a=ZjyAdWuDOD4A:10 a=If2VLsBYAAAA:8 a=y92gWpkwgkqGVycqOcUA:9 a=QEXdDO2ut3YA:10 a=ZCxjKSnKyCmnrEQjtP-5:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1665499716; bh=jUKefJ7nD8jTSogSxkBbpl1KLj9P9h9qX9lLjp/WBWA=; h=Date:From:To:In-Reply-To:References:Subject; b=Oz+Qd9wKDumJKiyrxotzB86mO6sGqdrfSY7UKHsdXzpyHI0e/TSeHbjKiFOV4i+MM +vcgQ5iQOmD3TMpNLvjZGFMgKPuAn0/2MJqwn+Njh/tqO6U2FL6xUKEE6kwT+OZL2s tbEZiZdHz2TxdKFnI/0ocgQ3GtyBNi4Jc9oO37D7m33wJEjeyZE5py2408ZNajXUFK 2wuTP0n8j+4tzGlDRt4SoSQTSODKvQEKzlBv42s8x++QwneF+jAm8TYhFutMWOglyR nsjyJDSU2eosdAaXHzSKqw45yc2ffM+pn04PB7hAHbXVocQAn2JPBJDI45bYIqjyQZ BZ3L+i8BOfBIw== Date: Tue, 11 Oct 2022 15:48:36 +0100 (BST) From: Peter Stephenson To: zsh-workers@zsh.org Message-ID: <112626329.2649601.1665499716807@mail.virginmedia.com> In-Reply-To: <2fb79279-47c1-f3e1-3331-fb84966a6258@zentaur.org> References: <473d6200-de7e-05b0-8ec1-cd49c4258cf8@zentaur.org> <81965a4f-fff9-5a14-fac1-784ac46a6667@zentaur.org> <1540859773.2640486.1665494635446@mail.virginmedia.com> <2fb79279-47c1-f3e1-3331-fb84966a6258@zentaur.org> Subject: Re: use of rand() in zsh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer X-Originating-IP: 147.161.224.167 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfKHthVZf3zKEwwDy3FHI8q0LHhXVBUly7L/krsGQCs4VRGRq0F1R3EwS7G30H0BibJYLv6Sg4IsZ9Qc7J6hXIbQxkIwkm5zdHd75p2QOtPSdCaZiZtlM D3EzR64KzGQLdH29IvKZCwKII33J+TNhNbNY65AuoqyZ1HGZYwzu5xQI4YhTNBlUornTdwRvzZ3UA5nmAqcRwh7aOGJYlRysMjn59F6suDe4q5Ndo7by5J8e X-Seq: 50783 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 11/10/2022 15:15 Clinton Bunch wrote: > > > On 10/11/2022 8:23 AM, Peter Stephenson wrote: > >> On 11/10/2022 13:51 Clinton Bunch wrote: > >> > >> 3. Write a module (e.g. zsh/random) that introduced a new special > >> parameter when loaded (more complicated, but isolated to those who want > >> it and possible to fail on systems that don't have a kernel entropy pool) > > An autoloadable parameter gives you something that works basically as if > > it's part of the shell but can be turned off as well as giving an error > > if the module isn't available, so might be the best bet. So the > > .mdd file would have > > > > autofeatures=p:SRANDOM > > > > pws > > > That's a neat trick, but as someone who has had to hack to build > software built and primarily tested on Linux, on a Unix system stuck in > the '00's (if not the last century), I'd rather have an explicit > load/test for the existence of the module than have it blow up on a > system where SRANDOM didn't work. (8 years as an HP-UX admin) > > My $.02 for whatever that's worth. :) You can do that too: the autoload only triggers if you refer to $SRANDOM first, at which point the module will fail to load --- quite possibly in an inconvenient location. But if you write your code to do the load explicitly it will check at that point. So you should have the best of all worlds. pws