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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3553 invoked from network); 10 Jan 2024 20:27:14 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Jan 2024 20:27:14 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1704918434; b=pOcWq8gHh2oh92t55c5+DZcySTE3TvoyDjrhnq4B0jc7nHQkN9WLIkOnQiTktKpkiXtoOPUjv6 vTLYf0K14Q5zPqK+F7990BdYglbChc31bd9WvWE6w7Zdw/8lbTLh4vWFUgOjMC0Hw7JnMn04VW xAGoNiOaJsFWt6dwplmRIU2Cwm90FwBE1cACdz6pyQ1F9FbND0UjwhauFQy5Y+wvt+ag9AyvOp 734M5wfFRzNRP6koJlgVpT8fMusKxyTy9qS1Zg1G8zv1O7JVZA026DCgnhtndNsUYp45dyfdlk Mxpy4EVwmrZjc54NhiUdvPB+u2N8ms6LNVfWsGykJCSQhQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1704918434; bh=7UwCvB2ioWV3ibHRx5dqcfPeWqZHk//qwN16qtlapaM=; 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; b=Y+5Ijewrkl3dmcaxHPJo3UL5GHAvlfI2Xx0W7UCs2qZo+ZerXIj+BdRRBfDCN/8ucL+PXbQ7u2 Mf1UD595mHcB4DXpf1y6a7yOZF8SdO9jGgmUWPK9ijOWo8rLMQxvIqXQrc8HxfhgqJcmelPex2 ozGMXblggkeHtMx6ed5uJv1TGLMiQeB929yctuMGDgVaQClqrIKw7OF7PTfP9qrlhxiISFy0Bv 1Al8tAnGYGYSSFMzSDskb/6RDfWe7VgQ1bZVo3Q3nrAmqW6lKhI510m4f/g6Tp2jWGiUKHP7wz Ah91bgH3gUGIZkwtCd2ftStbWh9Sm1wpH5PfjkUCGnciQw==; 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=YJJyv6uxYc0CmuIxzZm87dJ396cd30p6ZCiHGbkv0qc=; b=i3kciqKIRUouF6reV2DkhZfDsF bqKUjHbsJBACt1w1VHwp/zI21vTzj3tM/hLKy+PtwGOE1Oeg1KLjzesNwUl0+s0WrYAQoLlnYlsMA 5RX8aqlKFhqb5WuqzCgXDniVEj3V6VmONIY8nMa8uGZZSP2IFSpAJa0owaer19pHjSgxIOh3Lc8rh oQgbziJbgXrf0rRFWu1Dvnz/tdtP9nuXWtC/46KjgQ5r1sDzVfUc2CfezKy/dGyCXRHMvw15cO79i 99zUzRuNSwCmOZ7eJvLVa2NWn22HHfppLDyezvHEY9EJkXHBl/iXjhp4UAeD5pZzFxblMKN311g0t bUzfBpmQ==; Received: by zero.zsh.org with local id 1rNfAP-000DFS-GC; Wed, 10 Jan 2024 20:27:13 +0000 Authentication-Results: zsh.org; iprev=pass (mta03.eastlink.ca) smtp.remote-ip=24.224.136.9; dmarc=none header.from=eastlink.ca; arc=none Received: from mta03.eastlink.ca ([24.224.136.9]:44007) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rNf9j-000CZ6-2b; Wed, 10 Jan 2024 20:26:32 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta03.eastlink.ca ([24.224.136.9]) with ESMTPS id <0S721MVODBC8E681@mta03.eastlink.ca> for zsh-users@zsh.org; Wed, 10 Jan 2024 16:26:29 -0400 (AST) Received: from [192.168.0.11] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp02.eastlink.ca ([71.7.199.167]) with ESMTPSA id Nf9grS9dHtqGENf9hrDQfd (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Wed, 10 Jan 2024 16:26:29 -0400 X-Authority-Analysis: v=2.4 cv=Zvoraf3G c=1 sm=1 tr=0 ts=659efd75 a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=IkcTkHD0fZMA:10 a=Q0AwC6jzOh95Bz_zotoA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeiuddgudefhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfgtefuvffnkffpmfdpqfgfvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpeetfffhgfdvfeefleevlefhgeduveekudfhheehvefhkefhveeiheejjeehfeevgfenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduudgnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <4e5aa5cf-dfad-4e0c-ac38-8631d1c4ccbc@eastlink.ca> Date: Wed, 10 Jan 2024 12:26:28 -0800 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: proxy name for array Content-language: en-US To: zsh-users@zsh.org References: <41f9b4d6-8f4a-4220-a86a-b7ccf690bd89@eastlink.ca> <2546420c-deb1-4dd7-a0e8-7b9db463503c@eastlink.ca> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 29443 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: This works.  Double indirection, but she runs. function called () {     # Am I tempting the wrath of the Gods? :     temp=( ${(P)${(P)1}[pages]} )    # Temporary array will be used to hold content of 'Pages' (or whatever else).     temp[2]=50                       # Set some test values.     temp[3]=100     temp[4]=150     echo 10: $temp                    # How are we doing?     echo 11: $temp[3]                  # So far so good.     set -A "${${(P)1}[pages]}" $temp    # The hard part: write 'temp' back to 'Pages' via the named input array. } typeset -A main=()       # The main structure. Contains a dozen elements but we only need one here ... main[pages]=Pages        # The name of the pages array. Pages=( 1 )              # Initialize.  This is going to end up as an array of numbers. # Now we jump into the function that will modify 'Pages' -- or whatever other name is held in '[pages]' of whatever structure name is passed. called main        # Push the button. Don't look at the flash. echo 13: ${(P)main[pages]}       # It's Alive!  It's alive, it's alive, it's alive! echo 14: ${(P)main[pages][3]}    # Now I know what it's like to be Mark! ;-)) echo "Who said zsh doesn't have structures?  She does, they're just a bit tricky to build." ---------------------------------------------- ... subject to improvement of course.  Or can 'temp' be avoided by direct access to 'Pages' but via similar indirection?  Probably too complicated.