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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4466 invoked from network); 16 Dec 2022 00:06:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2022 00:06:12 -0000 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-Type:Subject:Cc:To:From:Date: References:In-Reply-To:Message-Id:Mime-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=QiY3TCQMF2xuZaOr2iPSXQk8M6dxzGDEv/VZR/0QdnQ=; b=qwIcWVdsDJHHpR1rCrsiiAM233 gMXAu6H6lejlPBRQ6ubBeEvYWIFX2B3EkkfznyCpWzZ6CNQFiEm1Ogtd+7Tz2ttG5W6foQyIfucB/ EsAXeBm/dv52lQcQdghHtluHw0BXQfEndXCzYDx3AwIjPEb9on/TsvdW4C0+dKwl1Gyxnj0ATiwGF 1LvCoV8DxcWPBPwSBpSC3acVDe92h4UfxEODuzPJHXL0KpH2OAY1s3u9qiLgYZRFbvlriv8VGkhhZ s7njZbe/aAMgaIYTTR3l2zVz25rdHyNS5vFO0XCVLneA70kqxomvhvds0r6NiMJjEJWUS+jr10yEh jXBy1pJQ==; Received: by zero.zsh.org with local id 1p5yEt-000Fvo-VB; Fri, 16 Dec 2022 00:06:11 +0000 Received: by zero.zsh.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1p5yEN-000FHG-UO; Fri, 16 Dec 2022 00:05:40 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id 38F5F27C0054; Thu, 15 Dec 2022 19:05:38 -0500 (EST) Received: from imap48 ([10.202.2.98]) by compute1.internal (MEProxy); Thu, 15 Dec 2022 19:05:38 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeigdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreerjeenucfhrhhomhepnfgrfihr vghntggvucggvghljoiiqhhuvgiiuceolhgrrhhrhihvseiishhhrdhorhhgqeenucggtf frrghtthgvrhhnpeelkeehjefgudefgeekueegudeghfevvdeljeehieeuffehveejgfeh tefhudevhfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehlrghrrhihvhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqudduhedu keejjedtgedqudduledvjeefkeehqdhlrghrrhihvheppeiishhhrdhorhhgsehfrghsth hmrghilhdrtghomh X-ME-Proxy: Feedback-ID: iaa214773:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id E2B7031A0064; Thu, 15 Dec 2022 19:05:37 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1185-g841157300a-fm-20221208.002-g84115730 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Thu, 15 Dec 2022 19:05:12 -0500 From: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= To: "Ray Andrews" Cc: zsh-users@zsh.org Subject: Re: uninvited members of associative array Content-Type: text/plain X-Seq: 28540 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 Thu, Dec 15, 2022, at 6:48 PM, Ray Andrews wrote: > I just noticed something. My big array has ten named elements but if I > print it: > > printf "%-20s %s\n" ${(kv)main} > /dev/pts/2 > > width 90 > window main > offset 0 > topE 1 > active 1 > 90 main > bottomE 48 > lastE 196 > hight 48 > 196 48 > List 1 > 0 1 > list List > 1 48 > currentE 1 > > ... it all works, however 'elements' 90, 196, 0 and 1 seem to have > created themselves, I didn't make them. How are you creating and populating "main"? Can you provide a test case that the rest of us can actually use? If I just guess the contents of "main" then I don't see a problem. % cat foo.zsh typeset -A main main=( active 1 bottomE 48 currentE 1 height 48 lastE 196 list 1 offset 0 topE 1 width 90 window main ) typeset -p main printf '%-20s %s\n' ${(kv)main} % zsh -f foo.zsh typeset -A main=( [active]=1 [bottomE]=48 [currentE]=1 [height]=48 [lastE]=196 [list]=1 [offset]=0 [topE]=1 [width]=90 [window]=main ) window main width 90 offset 0 topE 1 height 48 active 1 lastE 196 bottomE 48 list 1 currentE 1 -- vq