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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28953 invoked from network); 16 Dec 2022 03:21:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2022 03:21:13 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1671160873; b=OZGp7g3baYzQNnpnfZCNc2rxAzsunkuoCJVhzZQARmYeSlDL39ZNjj3zHNsTfjOcvJNxVOVq4I JFUCv7j83x7IrPA0YTtzJmodRkaG6gCcKrdKAIXtW7NNmzPaYwLdgNaeS08A51jE7/67/VU0a6 Qit8Bmaa8ULhfiC/sB3HW9c/lP8aPjR0pwScr5DJmo5W+DV62iurCkQUz/3k7kDBe16XvxqjKN pI9IuVYfIJYm6bmLjSbiYf3jGg2314GlmPr/fI5m05HaZjzdTnIJlNWT7jqqxSkVL2QHX4Ixpq mj1+acgTTNXT0sRDO8VtsC3UcVeFLxiZC9m97CLGb+z4OQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f44.google.com) smtp.remote-ip=209.85.218.44; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1671160873; bh=avH+w/8vd3WdpRZEH06GKvrFk/xmtKEw7CDq6dxp/44=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=QVropMNCeTDA+7xXU5ooHr2Z+fyekLnJpi/sDX33xLpN7xgAmTW0XQ2eI8Ghg6OMHbKe7m/Hlo v2pzPQDv5uCdNmkAOf6QqF0Wtwk/BEkGtvciuqk8xhs2afNxexfbfmy7smwrOYQeIHXXSGMGJc C2Sj3egQHnEPe9JHGD9vJMhRBlOt/l1kWtN/HK4zFpVHkRlSwVF7YGMva7R214eVB9xfQOfydU b2Ix0MAdKysFIEbVgNQZrQXARHfBFTbFpFWkaFDR2fX8y9T8Pybz7uD56DxDo/CQzRItuROvxF ndxmXu2B78xlVuc+yE+VqYT4qCg5cW+zJGPrMROhsyZAcA==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References: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=P8/hXaQYfCm70t2LZkirMmrW5BlRJTSFLSuh0I76yuo=; b=jdRFaQxbcsoV71Eq0fHIrmqDzN dJYPxSMOLabQPTphPE1Op4S7PL1NSb/R0ynfdd1xRZUHXs4vV5UtSsUU0WSGd//t7B0LSp8wjNWa/ uJPJvUVHJwRLmYe/R8vcyhBaiOzorqDgmqHLjUo29ewnTA8umchezTonwZ1XiVfbg3EmatJwI718r U+cwErzoUlaTCTw2Qay08LZuvbvCLbSWXUf9guilv8/ITlirzVr3yJQR47bfSH1wrTxggB7WD6KEE OxBOujwuIYK8Cr7GJR5pAslyIg7+lg731Isti3OP0UxLA/t9OIgbSmt8i9jsob9atqjrLLTDhMG0W WC0rx3mA==; Received: by zero.zsh.org with local id 1p61Hc-0001pW-If; Fri, 16 Dec 2022 03:21:12 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f44.google.com) smtp.remote-ip=209.85.218.44; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f44.google.com ([209.85.218.44]:38487) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1p61H3-00017v-Sf; Fri, 16 Dec 2022 03:20:38 +0000 Received: by mail-ej1-f44.google.com with SMTP id m18so3223594eji.5 for ; Thu, 15 Dec 2022 19:20:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=P8/hXaQYfCm70t2LZkirMmrW5BlRJTSFLSuh0I76yuo=; b=oIOivll9upf+5V9PMaw+wwcNRcKE07pLk5zvSQlEAIHB/sU5sGBMD9soQ6eMMXgMHm IMhzQf+wNBKQLonrFWlunarECewfu87ZpkkEe3gUE9n77jtCprOd6c7F+avkiMaJC+Nw vvtKyfADmRqDm9QQr/otWX4kMOcr99mEKVSW/BxQ5wTv3j4qe5cc0PS4qB3Tm/52tr7P YGgdEsM3a4kxJmxox9Yp+UiAwTbyFHTr+e02shko6GezQhZo9BhCgLQpdu+W/GUNDe3R kJ3uydT63dVLN/JJRxLwv8h+CnAWLV9i6izXmMU4WIeohfv+HSs8ebQZ9nReNVsBkbnN XkBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=P8/hXaQYfCm70t2LZkirMmrW5BlRJTSFLSuh0I76yuo=; b=umWS3hEk25OuCrzveHL2xkOf497fe76k0E+bS/svB4lyej5hAe5pR4dRSxRZVcsrTJ wNZpLEnsN7eY++vS6nbCbjM1ttjL1ca3uchzqt61CNDiqhZ8Z3ZRdHfVd1Yzkwjdt7te wVNbus/8tGkre52N/eOvl4wdXnHLSXPxKhyptYMvK0NCA/XH8Saa2XeZgSWDS+UEjvhN /DSkF4K3znsP2kLdYv8glZT4Ut3vv9lYjl5UfOAQrl1Ts3wqy6bRaXLfJWNhWmWRFoRX 0gokM91++TzJb3gxTeFe0luwYQmgcBUKhtm67wzY2eoGY8OprIQyIOSwIIVYkGJBC1pC Fn4Q== X-Gm-Message-State: ANoB5plPhvFSvBoTRAMZFfttEntAyhh6rn6nkrtrLu/HGBu3nYQqZjrh 8kbVviRSAI/NW6BasQc77DatPhGM1apddZ8hdt7bBw== X-Google-Smtp-Source: AA0mqf4woHJJXsTTx3cBcjcaRquX7xU1QwrY4aeUJoTmHPsJbutV2oe04Y1uHF1xfv0BGFvDxr99hc9Gz82huigFfgI= X-Received: by 2002:a17:907:1627:b0:7c1:413d:5ac with SMTP id hb39-20020a170907162700b007c1413d05acmr1810602ejc.699.1671160837279; Thu, 15 Dec 2022 19:20:37 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Thu, 15 Dec 2022 19:20:26 -0800 Message-ID: Subject: Re: uninvited members of associative array To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 28546 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 3:48 PM Ray Andrews wrote: > > I just noticed something. My big array has ten named elements but if I print it: > ... it all works, however 'elements' 90, 196, 0 and 1 seem to have created themselves Let's look at the "mystery" elements: > 90 main > 196 48 > 0 1 > 1 48 > List 1 Now let's pair off the values of the "expected" elements: > width 90 > window main > offset 0 > topE 1 > active 1 > bottomE 48 > lastE 196 > hight 48 > list List > currentE 1 Notice anything? I strongly suspect that somewhere you've tried to copy or save/restore the array by doing something like list=( $main ) main=( $list ) but have forgotten that for an associative array $main means only the values, not the keys as well. Given that you later say "main" is global, you may even have done this accidentally while working on what you thought was another parameter named "main", and now you're just finding the leftovers.