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 5540 invoked from network); 17 Dec 2022 18:11:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Dec 2022 18:11:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1671300697; b=WzxAjZEHzYLahovBf+H9UPKnNhCSdIUy4N9In7uKoG7MfKv0KxnhkpQrud2FwLtRSLrrZV5lbA 3e0iDhF3WP7vRXLZJIjOJQ5aQn6co3bk+2ptr8lMekM3TJ3fZWdvmfyyYZxLXHAizi8uNr7q1F NNCrB6BGpmejKHSm+uCzvEYOaShxRvNCJX+l4jSFLeFg6HPyE3e4zHaGij4jzCXbHbKd8KN0wZ 6Wy2lKGlA+Oq9fki/rTdGpC0AfsKSAILyubCcWhSzxUgzra8zb3jOHv+ucn+2fiGx9PjLI6zuJ Ycpm4cBt720X4WKtLP1U4BIo1m1sDmNR+l4klUVIkhIaIA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; 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=1671300697; bh=XwWVx3iagw4S7i4rlw+GI16mgKBs4nbQOFMl1zYgC04=; 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=RSKnL72bolExmVI9Y3fw4eIcdXETCmDkpJmetCFelQyWepZO53W96T9edG46kRR3glyHzyZWmh UDsYb/M5743AJkGLSBwd0QnMvqh7GZMxJt5xWETXVMQYf1gMgj//TLvr26ZoRoKeIF6+BDsq70 iCg7mfWpFfxjFpYK15em8iVdGUPbEUrjxpk4Paou/bwF/RVk0rDPJ0BU48XCtz3GwD6una047m vOEUZ8W1D9oOMM40l5FDbgQe6Aj1K/ztxQ7wVtkCA+5j7mayLqHDwO5ojsAx7iDc4QumjdP41b 3lzQqAaeGiHuKwEmUM20Fb1JUI8XeiKXXxSSglG+kb2HXw==; 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=zofIsdIwZiDk38s0PEwuRrUCE8MLUD/EpwH6eIOYqeU=; b=Ra4hNTKiVzYAzPmnGN47WOnRCM zkitxDucZrnF0s6BUt0LzjPIwnS8+y1B3FNIavqS7R3V/EaRui+/K3OZ/yMV6hjgaNBtpMLCoM5b+ KSnVrwbMbLc6aFdahm6eVVSn1gAsPTyW+3E7d2WSDRqkBNfw5HxbOEE9DpDV9Qrr0Zmv5D/zzILLg i+3SReVCurrNnzQuZLOBNOIS9tk0/Qb8MYN0aIaaOaFv/jMh3YkSW1ST8NmmlxvjmkBHwqNZ74Asc qo7UzWAHJGNNx11XcgSXoPB4/kLiKc8AklwftQNbVF4ZCFQ5Xi7JCrtAVzUFGledxU7qj2vdnY780 hbjbq4Fg==; Received: by zero.zsh.org with local id 1p6beq-000KfU-Qo; Sat, 17 Dec 2022 18:11:36 +0000 Authentication-Results: zsh.org; iprev=pass (mta01.eastlink.ca) smtp.remote-ip=24.224.136.30; dmarc=none header.from=eastlink.ca; arc=none Received: from mta01.eastlink.ca ([24.224.136.30]:40005) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1p6be3-000Jwz-5u; Sat, 17 Dec 2022 18:10:47 +0000 Received: from csp01.eastlink.ca ([71.7.199.166]) by mta01.eastlink.ca (Oracle Communications Messaging Server 8.0.2.2.20180531 64bit (built May 31 2018)) with ESMTPS id <0RN100NIKRCZOJ20@mta01.eastlink.ca> for zsh-users@zsh.org; Sat, 17 Dec 2022 14:10:46 -0400 (AST) Received: from [192.168.0.4] ([24.207.18.108]) by Eastlink with ESMTPSA id 6be1pkQitEN8v6be1pkr1b; Sat, 17 Dec 2022 14:10:46 -0400 X-Authority-Analysis: v=2.4 cv=IPDESCjG c=1 sm=1 tr=0 ts=639e0626 a=xN66ZtSbq5jdJYpBp7G/jQ==:117 a=xN66ZtSbq5jdJYpBp7G/jQ==:17 a=IkcTkHD0fZMA:10 a=EhlFYjdlOkRXRMOx-CAA:9 a=QEXdDO2ut3YA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeelgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfgrhicutehnughrvgifshcuoehrrgihrghnughrvgifshesvggrshhtlhhinhhkrdgtrgeqnecuggftrfgrthhtvghrnhepiedtjeffvefgtdehgefgteekueeggeeitedutddvvdduteetffdvveelgfeukedunecukfhppedvgedrvddtjedrudekrddutdeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrddukedruddtkedphhgvlhhopegludelvddrudeikedrtddrgegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Message-id: <27c7320e-7677-1268-3bf9-59939aad067e@eastlink.ca> Date: Sat, 17 Dec 2022 10:10:45 -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> From: Ray Andrews In-reply-to: Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 8bit X-Seq: 28575 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: Getting some scent on my troubles with the AA: I import one AA into another like this: n_input () {     set -A IN ${(Pkv)${1}} # Copy the array to IN, the working copy.     typeset -p $1 > /dev/pts/2     typeset -p IN > /dev/pts/2 .... ... and Roman has said this is correct.  For all the functions that call n_input()  everything is fine.  Given the array 'main' as '$1' to the function, typesets show: typeset -g -A main=( [active]=1 [bottomE]=48 [currentE]=1 [hight]=48 [lastE]=45 [list]=List [offset]=0 [topE]=1 [width]=90 [window]=Main ) typeset -g -A IN     =( [active]=1 [bottomE]=48 [currentE]=1 [hight]=48 [lastE]=45 [list]=List [offset]=0 [topE]=1 [width]=90 [window]=Main ) ... perfect.  But there is one exception.  The input array is the same but the output turns into a normal array! Input array is 'files': typeset -g -A files=( [active]=1 [bottomE]=48 [currentE]=1 [hight]=48 [lastE]=332 [list]=files_list [offset]=0 [topE]=1 [width]=16 [window]=files ) typeset -g -a IN   =( width 16 window files offset 0 topE 1 active 1 bottomE 48 lastE 332 hight 48 list files_list currentE 1 ) ... subsequent assignments are obviously going to be haywire and they are as we've discussed.  Now why on earth does that happen? All the keywords are there, and all the values are correct, but needless to say I want it to be an AA, not a normal array.  When 'IN' is written back to the the input array ... sproingggg .... BTW the order in which the elements are initialized at first go seems unrelated, it doesn't match either typeset.  I thought there might be some artifact in the input values but can see anything. The array consists of two strings and 8 numbers.  Quoting makes no difference.  Options are the same.  I haven't a clue where to go from here.