From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id B924A244D2 for ; Tue, 21 May 2024 17:44:37 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1716306277; b=Y+cASLPeCMpH47YUohuqCjwcPhB3mjwDqOnHJcFZ/qfMLVGKBqRu8eiRhpDtvyvhEuIQKX2ENt Hc1Y3qN/JkRWTirb5BLdqOh1KKY0GRdmlAD4jsVHbs+IGR9QZLjk9YOpWBBv5hpu3eRXwASNki hGzQtJ0RSs6V33B5gFaaIip2vDEIpy0v8G3tYl8VmA5jFDAMN4pIxLY/UPFmUuBWJmUG2IUo/0 9kmmFgDDMWg1d1HhHbBxWFthiCg7NcVZLF/aICaQ4I21H3W/Jh9w1XWTFftFdEg03s5+XqkPNE 4GhixJvhi454SjfBP2RICGmPSzLESwpioUMhJZrcBNtc3g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f181.google.com) smtp.remote-ip=209.85.208.181; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1716306277; bh=lJyEowkD97O9zexZnZQVzohKy2y05+xNEg0wJwTcwOw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=CBMB82SsJH+A3HODnqRXwqmeoYNv7XMPGt34e6RR3s/91Spyx28ytQabXSkGUjMkbubEUD/Y2W aQ4zExJjrBMlBppfTVrWsKXL+PsWtouN/1gk61yic5cGLYvzY6rSwqjkjfGrhMfwtgUkWK1rG5 n9VQ90CMQqFX3lD8a0DqJDyK7O4x6Xpojs34X/uz9v99uCN+JavcG8V5/EnxuhcTT+ih0RcRzJ I1LPyTJreK0fztyl8xWBLMglpOz7Fy+1S6Al9Q4LwK4PnvVYbJ5Bhu7l4wt4HsZ4SRjONgEFhe Cdv5MUgWarSnadN5gXLTWMtRnwMfyWJJRKpjTzNOyiD6Mg==; 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-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=nOcL+vYTLFBpRtcYj6wLV9BImpiNjzmVfQ/HNMP+v1M=; b=jUO6ln6tcE+ni2D7Xil2J+eAWO pLxLoTajiTZ2UOkIwJfmqV7IaBx7icU5mISRkSczNuG+hnuEpNuU1OcHo3tAy/CBJtURyCaEk6OHI T/AlRE6Ar+K/BfDDDt+YBl9hZy98p2zicxJ9ebHs2UhsvUYKn6+D7+IARH4LKbMZO9SnhpvJJTyVr GOro3HN3ldhEWvunFIMC21fO/3vGaF5vZRPyteOP+bH5uHihsOuchHVEiJbG5TRi+ID1yTpQ8v0mC KhQL7Ca71q/4ZE/KK4d7Z4JooN/ktVYS/HwpABA6tFxxAPPPsv9vgWlSDH/1+nSc2/N7ZNJEwS9DW pcHREuvA==; Received: by zero.zsh.org with local id 1s9RfI-000A25-4L; Tue, 21 May 2024 15:44:36 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f181.google.com) smtp.remote-ip=209.85.208.181; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f181.google.com ([209.85.208.181]:55363) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1s9ReP-0009MD-BR; Tue, 21 May 2024 15:43:42 +0000 Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2e3b1b6e9d1so64885181fa.2 for ; Tue, 21 May 2024 08:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716306220; x=1716911020; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=nOcL+vYTLFBpRtcYj6wLV9BImpiNjzmVfQ/HNMP+v1M=; b=Tmunrhym/ZNCiWn6WZmxvw9y4FfQ49OAAxpwRYptj3q+AESj14P1MbXCSJIlwPz2Ti GqgXxdOHAMb2qVAI0jPWtRLzdOSNE7wG/efRa6EY4iiWHXSa9i1ShsXxmOU4l359oUc6 3NmpZi7lvfOIEoMJ1Jb7nxGwDybjVf9x5Hzg3uXpAu+bJfd33dsEXiN1CB+x8d2mmhKi pAjyaJ+63SGIj40IV275OlXeeP08Yyx8ljFzu/HUCSE0oxefekg4EKK6lrDaESEiMewE Jk2qaq18j1q/WBikaLFMwaPoum/eC+FPP5kQnHLFaXVmllocfqwmqrfenrkpmyOEaw+R 4Rpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716306220; x=1716911020; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nOcL+vYTLFBpRtcYj6wLV9BImpiNjzmVfQ/HNMP+v1M=; b=Xz8BVis92qGVV1V8myvJVLmjlj6ye1oBeaS6h6yLcjnHyp+IOTJqtzhFiWVLGb5R/d nakaPWPJ0xGfYoP0vHpNS+mUWRxTWbxItDG9oVDTJRR4uL6SyeNOTao99DGoi/wMs2rF L8VLhOkTjdIpHS5fu9fm1ZeFdVL4K9UHDtL5OPBZvkD3NAo2KIdHVd/aWVpqXPcqmc5V ABZUzjR5MME8JME6NSFObFOG+XQyPRmfqM6jfgTX8zVdidKH55OopUNP2goanvBKU4uy loQo49vfhntaR+UoCdFIsI4mrRByUGw9nEFXdJeiEkbtyURZIo5k7yLV42v8Dam7H2LG cmuw== X-Forwarded-Encrypted: i=1; AJvYcCUDkK0ifZvPIPfcahy1tFx0WAuDQnboSxDYFFYqpOQa1tJaggRcrdi++2jwj2v1JE160uZl2Am4sefWaK3FvT5DAg== X-Gm-Message-State: AOJu0YxEWc/TEqmEvWpvbYjJDK0iX19ptIa5qXbSlp8CauVkjVq/EppW HRoZIG8hFwW34N4M0j47XcL455Om0bHNasqPKZmdugt1MxfESDkSUkMc7m+mqiHvf+IUDunXL9h gGp4CTd3FQ/Ayn+3Is45XQxqfFI4= X-Google-Smtp-Source: AGHT+IGWTvKiDoS3pcZjaTlCNCl/CJ63ZX3C0twy0w36zjWGueODeFIdZb+3K811fZFAYZkwr9G4uNGQHzxHY52gfLU= X-Received: by 2002:a2e:b6c2:0:b0:2e1:ba1c:efea with SMTP id 38308e7fff4ca-2e51ff4d69fmr206805011fa.19.1716306219971; Tue, 21 May 2024 08:43:39 -0700 (PDT) MIME-Version: 1.0 References: <2cfbd7e7-0930-44ba-a0bf-99d04762fb92@eastlink.ca> <3a1ecefa-b0f9-4e63-bbf2-bf4dc2822090@app.fastmail.com> <91cc2797-db97-41d4-a06b-207532ec13f4@eastlink.ca> <2fe6d342-8421-4aab-a9f7-062ff85c5546@gmail.com> In-Reply-To: From: "Mark J. Reed" Date: Tue, 21 May 2024 11:43:27 -0400 Message-ID: Subject: Re: rigorously predictable random numbers To: Bart Schaefer Cc: Kannan Varadhan , zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000913b530618f8ae9a" X-Seq: 29958 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --000000000000913b530618f8ae9a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, May 20, 2024 at 6:57=E2=80=AFPM Bart Schaefer wrote: > This is documented in the "Arithmetic Evaluation" section of the > manual, about 3/4 of the way through: > > An expression of the form '##X' where X is any character sequence such > as 'a', '^A', or '\M-\C-x' gives the value of this character and an > expression of the form '#NAME' gives the value of the first character of > the contents of the parameter NAME. Character values are according to > the character set used in the current locale; for multibyte character > handling the option MULTIBYTE must be set. Note that this form is > different from '$#NAME', a standard parameter substitution which gives > the length of the parameter NAME. '#\' is accepted instead of '##', but > its use is deprecated. > Note that the *## *form does work fine in conjunction with parameter expansion: $ msg=3Dhello $ for (( i=3D1; i <=3D $#msg; ++i )); do echo $(( ##$msg[i] )); done 104 101 108 108 111 But that's not particularly efficient. --=20 Mark J. Reed --000000000000913b530618f8ae9a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, May 20, 2024 at 6:57=E2=80=AFPM B= art Schaefer <schaefer@bras= slantern.com> wrote:
This is documented in the "Arit= hmetic Evaluation" section of the
manual, about 3/4 of the way through:

An expression of the form '##X' where X is any character sequence s= uch
as 'a', '^A', or '\M-\C-x' gives the value of this = character and an
expression of the form '#NAME' gives the value of the first charact= er of
the contents of the parameter NAME.=C2=A0 Character values are according to=
the character set used in the current locale; for multibyte character
handling the option MULTIBYTE must be set.=C2=A0 Note that this form is
different from '$#NAME', a standard parameter substitution which gi= ves
the length of the parameter NAME.=C2=A0 '#\' is accepted instead of= '##', but
its use is deprecated.

Note that the=C2=A0##=C2=A0form does work fine in conjunction with parameter expansion:

$ msg=3Dhello
<= font face=3D"monospace">$ for (( i=3D1; i <=3D $#msg; ++i )); do echo $(= ( ##$msg[i] )); done
104
101
108
= 108
111

But that's not particularly efficient.

--
Mark J. Reed <markjreed@gmail.com>
= --000000000000913b530618f8ae9a--