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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13619 invoked from network); 23 Sep 2023 05:13:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Sep 2023 05:13:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1695446027; b=m0VR33goqRIxkJlFvdxbu08aZ6ETNzDDW0YeuR0tPQVlvw7Au5PrtO4hfhpO8jHXjUaOWSskrl nPbY1D47phcfCgDqD66hze6kkSzk0kaRzbLPEADRS7ST/Y8UOkCd2dAgtjIZSjGRdATNGiO6Mc Jgq6g9cX57QckGIr4KOn71tXJP3LSUr5uVEUsXnJo6myYCYHQDVPDch4aUO6LZNS3497VUIBdx uAtXwBvTADDN11T3Fc/8qYd+90+wAS+nF8mMyodo2C6oNPk0sOj9qDnYVS+qONOJ7U1ifj5fZc KYiGyf1gXwX0vVQIiU4b4zgrnVIpoVX64VMyvwCvVcrv9A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1695446027; bh=MgiWvr+gCWm2Qu5AzxN0uNIk2h+8IWtwzlyKJEx0vtk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=HvGuapvLe2lPc0nLWr3RtvAlaCw3kckvPxv0Xs2AhF5hIEV0DlkAHNxWAA0suyxAmPXuzEAUuC Dact5ZCAaz3hWOrOmIknChY9Xc+Mbr7vRJORHOl+V6eJigIVWg6bKiYDTLuHW9+n9I6EDsXGJD R/n/ZtWhJNv0zJFDSHjrfadq/84UlVc49oyr8uhHwccetW1aSBn7y6gJBdPgez6z/IX3sWIkMx vpp+QXVsDL6UixHV6kP/kqNRvdYXL2JPHCRqJ8xW4fCS9FW2TnSqh0Jw9aJ67nKbLMOSjz34ie C0c6odyMSaDjQBQwowwcGW7WcCHlK5wOjeGXA8lqn7cAtw==; 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=6VOFKOWONMjqMvJ5ah+1e8ApaoDaE/leT7zMPM3mUw8=; b=PEyseWyiwrHDkuVP/4E8NiPJga 21DGhvO+BGwx9FS1NO5H9hyuzzhbokrWz+kyqqTqGjrYLmtRat6Z/oto63DPfanJBa1p+/fATbbxE lLxyLULpWJUaJkD2KrLfndFfhdjpa2xwFmoOBPOkTgGPYxUIK5ZJsXtCuEtBIkIoW7ZW5zqUQQCkX aDETJexH6jBF2Rb8Y1pBxQMW/UyVXkJmteeys6ax7N4rIqQaBh/g+1VNVMBS+LM79QeD4o71p17wO XETCGyzsDY9+XcD4erz19GKv4YxFXQZIxEH/Xogkp9F7cFL0aMNf4p4iIjx5nsj9xbRwaHj0vffM1 5dYxllug==; Received: by zero.zsh.org with local id 1qjuxd-000DUn-MR; Sat, 23 Sep 2023 05:13:45 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f48.google.com ([209.85.218.48]:60646) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qjuxI-000DDf-EC; Sat, 23 Sep 2023 05:13:26 +0000 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-9ad8a822508so391051866b.0 for ; Fri, 22 Sep 2023 22:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1695446003; x=1696050803; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=6VOFKOWONMjqMvJ5ah+1e8ApaoDaE/leT7zMPM3mUw8=; b=dfOiHt1vzLUHNi+C7l30c2UUAtMPWsPxMwYfPZAL2n3fZ7QsYsvVqB3rORfw/rwiAi Kv1Viyy5jL9oybL8gF78TQm08XBQAyq5qL228PsL3uf0efRtCgNpV3tc1JRQXPUk8ykG W792sjlbosU7uZqldQKyqyuj9iCeh0aSF0AgEgI9S91ajjHLid6LPO2wGyAsto0KFfva yTt6KEV7+sYEWZfXLvsEpMt7bs+nZnB3/eBqiNx91M8sMDUrkZPWCoBUZ3r0u3ZdAk6l r7vAq2YYdAI3AC0ZRxK73BNlE0LDzsxZHLhFZt9VU1pERkVn288hVrzFx2xX/QF4/fEi S8oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695446003; x=1696050803; h=content-transfer-encoding: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=6VOFKOWONMjqMvJ5ah+1e8ApaoDaE/leT7zMPM3mUw8=; b=At1s6r6G58GxQ4KdkC3D35owhJ+Sir1laepwtQpVykjLI00YsMt6JaOzWt33ao5Sok 7nkGqos2UlFLd72dfmV8POqPoAIHT4gz/B10AwnaaJ+6o9TK6f7tKmlKoDmWaMf4FSi/ 7LkT3cvf9VmdDucgXvPHQBNWYJ2HI/OMpagd3y4tPFsgST/nhR1DcSeo1R5Up3xlq1tz D/0x1VuAVZyNRnEkvo83xZp67OBZgdfu9oI/P2e8hBKzBkeXIa4jtOhQ7b78JorLfpwZ xrM16QHVK3/uKPTh6y0t4PHQOu/sPnUZMxsmRABLPaaME0voLDv4qTFwM0VQgsmB+Qpl OojQ== X-Gm-Message-State: AOJu0Yy2d4QeNA7NDJpMLR12lOItshMoOddD4MlpbvAesJWbxZGFYe9L f8b4O8zhVBaurSmstNqHeNdSS6J30vC/xjoYg8p/nQ== X-Google-Smtp-Source: AGHT+IGgxXm5rjGWYJRw6qCQ5DWLM9NkPlL5G/Xx4FjJeNnUDuaFcvOOUSLaZaZhW9E31u1HE7baUdlsMzTWf4xDjak= X-Received: by 2002:a17:907:75f3:b0:9a1:bd33:4389 with SMTP id jz19-20020a17090775f300b009a1bd334389mr936680ejc.74.1695446002991; Fri, 22 Sep 2023 22:13:22 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sat, 23 Sep 2023 00:13:12 -0500 Message-ID: Subject: Re: no-fork expansion with array var To: Mikael Magnusson Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52180 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 Fri, Sep 22, 2023 at 4:16=E2=80=AFPM Bart Schaefer wrote: > > On Fri, Sep 22, 2023, 4:00 PM Mikael Magnusson wrote: >> >> The documentation says: >> If param names an array, array expansion rules apply. >> >> But what it means is if you do an array assignment to var inside the >> code block, array expansion rules apply How about this? diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 86a5f70c8..837a85db6 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1915,8 +1915,9 @@ Substitutions of the form `tt(${|)var(param)tt(|)...tt(})' are similar, except that the substitution is replaced by the value of the parameter named by var(param). No implicit save or restore applies to var(param) except as noted for tt(REPLY), and var(param) should em(not) be declared -within the command. If var(param) names an array, array expansion rules -apply. +within the command. If, after evaluating the expression, var(param) +names an array, array expansion rules apply. However, tt(REPLY) is +always expanded in scalar context, even if assigned an array. A command enclosed in braces preceded by a dollar sign, and set off from the braces by whitespace, like `tt(${ )...tt( })', is replaced by its