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.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8549 invoked from network); 17 Dec 2022 21:53:02 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Dec 2022 21:53:02 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1671313982; b=PDuLZWzh65S82GZ8j6VtRQ1+AVWxlfuW4eFEoGT3i0jH7yM6JO7gwhTQWAAX6WoEj9U2yhye0v 9wXwsdZA7pXvLu7SPlMVenP1vI7voQrxnDH6y2WkFw76Vw7iMznWWOxAMlcOxRMB8699kkh2Ky hxvFwTYT2y3DK1HItGIxQTLHb2lIJWvk3ysUw6l+0G291ica/AO5mwTfYzihljo8YbfoU+pEbR oHm0YFoEc66znuKS24JtLR8w8uTAOHfPh3I2/xnAGNTKzoIw7xEdnRrEGE3MxIjk5J+fwjtmG+ 7PXVekyUm+UdXtYov+L02UOr7qG4mODrjbLu7uZlYQPZkA==; 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=1671313982; bh=u4of4WVjFkrBUB12hbepS1AliHzCrc4XiGqhonbPVgA=; 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=crAf6hS8sd9dqm0iza70PS/Zqn1qla4NTwbK5F+CVr+9XC3RmAOAxkT7bogdgwDkElr2/PAMFI h4VPNxxEedcTKTa6/WY16VNaqxwAKixdoYdBR/HJiwbgni0JT0PVbthWjx1m9bcYh5ETGUORE2 ofbFaa3gkjygMskStrjL/g0cCiQdlTSqEmCCQp5SHuA41QeNHcTdJXMQn+dNNcrad5dX2hShx8 AXw64D4vnXx+IoG5Mj0VONrjcoEHK1F4OTewQG0s2/SYQ2T2ReCs/M4bwxIG0fAs8Fg2d0/OQV HP8lRX18QT/BDrLQIK0icAoGxrABZhSSPI39AfBLGAI7Zw==; 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=nGjoAqigCFcwIy9qV2z+Asf6SYViWt53q+SdUaYKr8s=; b=AK1kjVSiwRNWrnW0BWWfSf0ZKl ywMR125/8KvzZY6CzubOvuIWZV9tIFfJgoiyCzeYHKtcuSePbRP7qGL4XUvbvepsUhBqUJM/IXIua rp2p/PZoiaETMsSwCUmTkS27UZXvhH8oG9VZtdBUKNdhhy12l/D4DXovH7zCqpjvZH6gw8J2XLF40 HWvfR7D7/AGIZWnonImQQBwpKmWvSfObEqKQFJhopwgneQJlhmq92LlYCa5GZkobyM5aSpPVeD2Rq SXTWLGZxcHMJMlYSKRNzAbew3/jrChxnIo3EzGaaMNAPdTcgZRHvNM/tGrpSk9bIQj6jZM6ljYe/l HHGtYYRQ==; Received: by zero.zsh.org with local id 1p6f77-0007vQ-H1; Sat, 17 Dec 2022 21:53:01 +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]:42393) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1p6f6X-0007DQ-Hq; Sat, 17 Dec 2022 21:52:27 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta03.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RN200HUN1NZU850@mta03.eastlink.ca> for zsh-users@zsh.org; Sat, 17 Dec 2022 17:52:23 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id 6f6VpkuDxEN8v6f6Vpkvgr; Sat, 17 Dec 2022 17:52:23 -0400 X-Authority-Analysis: v=2.4 cv=IPDESCjG c=1 sm=1 tr=0 ts=639e3a17 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=KIZE8rKqQbGz6g9JUWkA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelgdduheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepiedtjeffvefgtdehgefgteekueeggeeitedutddvvdduteetffdvveelgfeukedunecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: Date: Sat, 17 Dec 2022 13:52:22 -0800 MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: uninvited members of associative array Content-language: en-US To: zsh-users@zsh.org References: <46161d8a-c177-4134-836e-592e5c048887@app.fastmail.com> <902fb047-3435-89a3-e7ea-74e74075c2c6@eastlink.ca> <09d09690-08c8-4499-9011-9c45d7676f52@app.fastmail.com> <81952d4b-3ead-f912-f987-fe9a37dbd256@eastlink.ca> <27c7320e-7677-1268-3bf9-59939aad067e@eastlink.ca> <2c606231-ae9c-a7cc-8e35-e018ccead14e@eastlink.ca> <7a12a4c0-d423-4538-a194-18e9cf932fe9@app.fastmail.com> From: Ray Andrews In-reply-to: <7a12a4c0-d423-4538-a194-18e9cf932fe9@app.fastmail.com> Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28580 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: On 2022-12-17 13:07, Lawrence Velázquez wrote: > > I'm not sure why you brought this up. Are you using "set +A" > somewhere? No, but I'm still curious as to how my array got fouled.  As just discussed with Roman, I'd been using a global 'IN' and thus it will contain whatever was in it at the next assignment, and it seemed to me that a possibility was that the overwrite was not clean.  Reading up on it, there's that +A and -- tho I don't really understand --, it seemed possible that it might force a complete overwrite.  But I'm absolutely happy with my local IN, that's got to be better anyway.  And, per your advice, I have 'typeset -p's locked and loaded all over the place.  Commented, but ready to spring into action at the next sign of trouble.  This is another lesson in how one can't take arrays for granted, especially, it seems, AAs.  BTW tx for example of what +A does, now I understand.  Easy if it's explained clearly. Bart: > ... assign to array" where "array" may be either normal or associative. But if the array doesn't already exist, it is implicitly created as a normal array. So you must pre-declare names with "local -A" or similar if you want them treated as associative. Too bad it's not created as the same type as the input.  Indeed, aren't there cases where even declared types are changed?  Like, don't scalars convert to integers when you perform arithmetic on them?  By the same logic one might expect IN to become associative by virtue of the assignment even if it was a plain vanilla '-a' previously.