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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15381 invoked from network); 16 Dec 2022 10:06:26 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2022 10:06:26 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1671185186; b=iHiR2U6K9mc3nywQG8B+0YgRZ8xzL8bX4pEG+RuelvaPgwlgbY2HSdaQI2e7tfHxLFIJTOfHcc um58+fZSK8oTRm/xrwU39380yRgtxzla71ckJW1VOsWkykeE1TF4kK4+4zOHqSHp0EV/dLLbep snVQ4CodY4PBLBuST9B8Nd0Szsl5y0zWrBjNUmITV1UFDondgwibaAFz9TstVcMqF520oKgaDp DlAQA9zOn7y8zxhq/N8pK5Ogc1RUCWT2X1ZBTOJy8weHLbac0e2wA5cigS9WgnNo+/V3/W1gkS F9lYvQXi1KU6+bMulXjiYdnVdslfDXSN86i5MfX+En2Dgg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.17.20; dkim=pass header.d=gmx.de header.s=s31663417 header.a=rsa-sha256; dmarc=pass header.from=gmx.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1671185186; bh=cEQq8VGyhH5jSyCTeUDQ8WthO8mgoDIUssTa2m0/mzo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:To:From:Date:DKIM-Signature:DKIM-Signature; b=iTiWmvOsfmjL5YfbXvSWeAmmsU0Zrb4U6VMWlwFFCQmiUSRYIxCAUz7X/8YR6QsfbvoDK/wLPm ug8H4YFc7LouCkuCEtBr88EK+2SE37yc0mKxGk52lMJKLZCoa8sCTMwGTv0u0EL38m4J7FubV/ blFVAXcC9V1gqDYg1PPEGJeGgBuIpoCi/rFUljp+I1GO2n0mrQPGB+YL+/LUJqJjSxPZcijZ/w gvDbEGiPhrpIzpUk5qYbAvSlObGqC0dqXedEn7TmnKyGgMZ08YEMhhfJ9RUQbGVnozWhUpoIiA HLcdRxourrSqoX7eFXRzhIzRHa1yiwVWlAk9NrrZDG8FGg==; 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:In-Reply-To:Content-Type:MIME-Version :References:Reply-To:Message-ID:Subject:To:From:Date:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=ZaJO/Z+8k0qq4td0vjZRKHU1e+wg6EYv2s2zbSL9/zs=; b=ivibZKOLctAPUnsRqTW9OkJqWB hGT5KnEIautpX/wk4zOpJIolmW8LetRjpE+ubmvAdIOUJsvAGVn4vobB8FFgmqe9q7j219vxvlKYW eDKDmkjj+JSGnVoA/S4CMRC5aDGaEJgtAyaBdmeeJrqwP1vib6ntPyJouOkwwbcsTmZiILaQsDXV6 AT+ZMlvb3nDMWkILhUYezMkI0u5E2oHYg9kDe6Iuelu3/R37oF7GD2t355DW2CNHrvF2R9Hbl8/Sn 9NgnxgHuk5UytpUm6pIcZtrEdMfhn2H8uQIqSbzc1MZhTKj2FT6/QqfM4ZnzEPeGu35hnjwR4nSv4 UZg9aw8Q==; Received: by zero.zsh.org with local id 1p67bm-000Mmu-6N; Fri, 16 Dec 2022 10:06:26 +0000 Authentication-Results: zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.17.20; dkim=pass header.d=gmx.de header.s=s31663417 header.a=rsa-sha256; dmarc=pass header.from=gmx.de; arc=none Received: from mout.gmx.net ([212.227.17.20]:49031) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1p67at-000M5L-Vv; Fri, 16 Dec 2022 10:05:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1671185131; bh=cEQq8VGyhH5jSyCTeUDQ8WthO8mgoDIUssTa2m0/mzo=; h=X-UI-Sender-Class:Date:From:To:Subject:Reply-To:References: In-Reply-To; b=ffv3IputofobNKQmkp84yhDLwe7abUf2AO4UcBzlzEZ2eiH5jTVzw1+7UZyaryPsG iEayVmnITy5nhU1nIQY3sddCThai8yX6/ouvr/qBRsNO9ukQVs1OMm/UetGQalXpNT P6NUYOZYWp3D12ujQiFRdKMKCoTDvjLMLS9kAx2GIrlo0Gn9fK8KK28yvsGh77pwc7 Bx58hxlc+GemoYtVKKfQb/OMgZrjjGPuUvlYNgZcHdaVaIO6yFMJHMMRsllZ3pWCng zJviAv5MiINofvG+pqopprJRNZzuYeHglbV4IHx9mvAsfqedB0ua7fx40Rcby2PN+V exPWRq3ua76cA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from limone.obstwiese ([46.223.163.201]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M6lpG-1oz03Z0JSA-008M0P for ; Fri, 16 Dec 2022 11:05:31 +0100 Received: from luthien by limone.obstwiese with local (Exim 4.94.2) (envelope-from ) id 1p67ao-0000Wk-R8; Fri, 16 Dec 2022 11:05:26 +0100 Date: Fri, 16 Dec 2022 11:05:26 +0100 From: Dominik Vogt To: zsh-users@zsh.org Subject: Re: uninvited members of associative array Message-ID: Reply-To: dominik.vogt@gmx.de Mail-Followup-To: zsh-users@zsh.org References: <0c2b1f8f-35bb-cd52-3d22-0964a73945b2@eastlink.ca> <46161d8a-c177-4134-836e-592e5c048887@app.fastmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="GbOaj6oEK5+3pST/" Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:8h+ibBwQzKrIXFqTpWNk+2I3kZOl+YBGYd9v3NfywLdoY+jbEok aZQj+KxvqYyyb9oGxljuxsWRlN6em2nUd+idmBjgZisFJbVztBofgLZPU333wvLKY5Pxv1a 1NpTy9duTB+gLZwQ98zPuCqRNbeUTeR7Za1MkoHQGeCdwfsaFdfcbRCk+VhHm3+04ppDycK Opw07E01DvVkku5rNiYaA== UI-OutboundReport: notjunk:1;M01:P0:AyjVY4H33gU=;1HX2F9qaxpNGEUQwC5ZxbATe8uW fftjP6CGFOhPBAGtvTSxaCGGLcRuCY0JUcKupSsxEglOkdzTce+C7c7hyUfVSBGVW1H86JjlH nMKrkxENVFtdnnQJ7kMM+cgZ8CQIphxxKRyO09hHsriuiAF/F3WXG80ywMfHDKadgxS42e0bS xsa7XGFesdpa+5Ex7ApYFFKMHP03vKgqiPmnabpjhc8PMlM3GGWk0/an+Wktlp94pG09zaj0o rND+PtHBEE03FEiRxxgWV/clF2uZ5au7dWdpuHzT91fooez5R5N1V6CniHE4MkV7d+E4zI3ts EKNZ594Wv+UDS/oqF+/GLBVoYqttxAJiyL7WjWL9WnS5r6Vmi2Hqg+1XwcLYEdPQ6KC0nQwNu qKzzP0NoVOOd7890xHvRHpXqDz9QFeErig5x9NZgHQ+I95rqgRqlgLhNNgeupJj/XpIy+R+ZX om4VN/7K5xf8PbW6iaMK+8GmMMNAoy/KWyMzytsxOIxww/IT7WBAlY1IRMNdcBYa9RwF1YnIH 1IPD8vF30YAc9LyN+zgp8PMJQ9j3xL3MRwffVJfsKRtlErwoXWpYPjWomrRD4i37iqxd2SkQe B0Lm9hSwEIYIjt65p/eAXOMhrV4UpQ0GttYTslq1NibbTDCIFIDKdfyLN3SyUUIsPoBRZi8EW iL3xcuJWLe0KEfWxmrRufqmddrcQsuEX5ikSOrQQAKwVnRz0ufrGfKzTVIyAWYi+bcZn0A+io 7fNjkW3ubaHKqCQNr7Per/FM2chBOs7WfS2s7wbiB5Au3nS3eygMYeMIsYZYFyFaSewbuGxka /j4BvlgSzMTBVZ2MuMrQA/ZnPL2SKks0G2iUDWoU1TQwLYxU+m1h3b6HKEeJTvH70rEEhZ09U XnW539lS3Gt2q8gtr2MSbxCi5M3nnLNTa/oN+PcYSPvjq0r90MJty2iGJtKc0ag/ajH8RelgU 70yT5g== X-Seq: 28554 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: --GbOaj6oEK5+3pST/ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 15, 2022 at 08:16:46PM -0800, Ray Andrews wrote: > > On 2022-12-15 19:21, Lawrence Vel=E1zquez wrote: > > Or before. > Exactly the case here.=A0 This code has many global variables and ... we= ll, no > need to say more. > > Wrong. It assumed that "main" contained the expected data and > > nothing extra. I've already asked you to use "typeset -p" to verify > > its actual contents, but you still haven't. > > No need, zeroing the array solves the issue. Mind, I suppose I could do = a > forensic on that, and figure out when and where the corruption occurs The issue is not solved. You still have something that adds the bogus values before the reinitialisation. Whether this has some adverse effects depends on the scripts. (Sample script attached). Basically you probably do ~ this: init_main # ... main=3D($main) <-- Creates extra values # ... init_main printf "%-20s %s\n" ${(kv)main} This is a bug in your scripts and not in zsh. > and then, of course I'll use typeset -p Forget about the typeset, look for "main=3D$(main)" or similar. Ciao Dominik ^_^ ^_^ =2D- Dominik Vogt --GbOaj6oEK5+3pST/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=test #!/usr/bin/zsh emulate zsh List="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" mainWH="50" mainWW="92" typeset -A main init_main () { main[window]="main" main[list]='List' main[lastE]="$#List" main[hight]=$(( mainWH - 2 )) main[width]=$(( mainWW - 2 )) main[bottomE]="$main[hight]" main[topE]=1 main[currentE]=1 main[offset]=0 main[active]=1; echo ${(kv)main} } init_main main=($main) init_main printf "%-20s %s\n" ${(kv)main} --GbOaj6oEK5+3pST/--