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 23484 invoked from network); 15 Feb 2023 14:59:23 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 15 Feb 2023 14:59:23 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1676473163; b=ZxuzbTVGMXWgnnaq9wRCzGvIEXb2hdXoZHaXUz1HVUJWAwHxLUpA8FznWHbgvsEdrvFG0j8Bld pmEJy02GuysrPLR/xPGFj2NFGkCOzb5vMBLYMah/GPosBppVC8h3KSTrkUM+YulWay2U4+qo7z uayk3F1yhFB/E+Lk4q7IkeR42WNvg+62ALjCaBuEgPsUPmUu66ZcYxj+aYvxtVm4e9QGUR6wTr gghS7/ZDb2coGSP6l8IPaoJf96ZKOEE/qleaJpKbiNU6wIBz8AlrR/8mZO5BkcvErCu+J01nZu +BYF5ewQM7uw8q8+C2FW/JupvJzOJ+LQSYaAQNtyQOafnA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; 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=1676473163; bh=+KMdL8CLQkUUEB6m9+v6sU38Rx8plam7G7LS9ACGMRo=; 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=BS6lkYHsFEplxsCC9CmiMw13WQ9Bq8WBTTh3jzSvE1gIY4ZZEb2QWT5jIoI2Mlm2rqaIbZzqKZ rfpz9g2j0LNIPu1MYzeoAz10S24wqRegBfaecy+uYFBEi7cKF2ix3ZGx5vSM8TwesiyNIDT+L6 e9k9hcrEhD7A1Eq0k8qlWWNRMA3ODasD2VLY4uVVlQjBnNhg1PZKH33LnrFR8/rb+bgWr74zAp Wk8NXxeMwGDQwri8dQUTrKnAu2ngelUnYiUJTW2Dj3PAf+4K7Dvq7RVb/UpaYcy3JBlFumbJU4 6+apfP6Rr0XYDMXNEiJR4OobEMsZdzSFl0phVAJXYABM2Q==; 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=hLFsxffhFTDJNj5TAwg+z6FJoE0d2Gvgmr/k0W4txZw=; b=T/Vxn1hysLTboi6E1fVMQujsQa FVbIHBuIQNx+mjI2QcpkTKpYHSbK0kIxKBlwbPflIH+a5JYvBYeW7LZ/hLX5x6/ytkHMReKtN4t60 /NY/Wm2x39JSr1KA+ppVz8qkWXsdMZmUsAXot2qz/2XmM7YWSXrAznJk7cZo/Ugn8ohUUC+QB3K7+ v8xiTgLavo1YInbG7eGws6wMhZUWWaVBOqFCntfyvYphel7FSNJaTEMcnw3kWe++KMS4yGMX0ECTB 9t6nYCL4PM+HU+BzVOH+Nh8pwr+gumJ6DB7quCxKCyM/FiOJ4kr4gMXeQSVfTLGtV9iAzFO5+v6pI BuGjUurw==; Received: by zero.zsh.org with local id 1pSJFi-000NiR-7C; Wed, 15 Feb 2023 14:59:22 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; 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-f48.google.com ([209.85.218.48]:38614) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pSJF9-000NO1-GV; Wed, 15 Feb 2023 14:58:48 +0000 Received: by mail-ej1-f48.google.com with SMTP id lf10so16971782ejc.5 for ; Wed, 15 Feb 2023 06:58:47 -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=hLFsxffhFTDJNj5TAwg+z6FJoE0d2Gvgmr/k0W4txZw=; b=s2ewgeHoisvTwr8ktnm27W2EP07uP02EUCTamPPsR3LWjLiVwtz2FVWYjct89T59Qy 7OATn3L8aqUmf3MitHm4mgedMDDW5jJxlf2xKu3IjjI8zFLvyB0k/4bX+GEt2O1cAvOO QWks5CXBYyNM8KdrtCn8lEGsZDrBj7X4MP9HqcgHbHSQZ7ODDoihev07L7nGwAjpushD SCuyBYg+/VlYfONlcFPRDxjIc5L3vkkYxU+z7azDCSjaZ63OGyzNFXTp+CCIA38b+2Ew /9jLejyoHhoDkWPY/mN5xCJLuXvlU63/i09VVNtXACJcYKhjRBVxHPawaEu+Aue+K6WU p+AA== 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=hLFsxffhFTDJNj5TAwg+z6FJoE0d2Gvgmr/k0W4txZw=; b=l/e8WnS0390UQKhj3PkQY2AroTMNAt33XeeU+mh32pWaVXJGeW20FLRfXQVaUXT2ys agRqAYBy29hyyIpSmCdCvsxXdYQ9s2KyklBJG4rskEuMwN8Qj6VhtVpbieQrkvthLHFd PdQFS9m4NNsIHxUlz3bJSaarFwSjpNrsqDrwwmUsXEL1iMtQw8uz8c60Jxz4Hckn/3Sc iTvLZtuJcjiWcFZZdY/otKeqiNvrcOQIl4p6xg5GE97K1/xytlQE9gQDWxYl2sXuyxy9 f8JoP0z/nti4YrAx0gSf2PJ2I33qCvRkogR/Esv9HYBlfbmX0bSzzO0LYVIqqkpdAQKc rmrA== X-Gm-Message-State: AO0yUKWPH9wXU5hO1ALjwKzCgPMHdRPeS0h8MxEnd5fA9H6iL5hEuUSc UmWQJZIjW3X3kGl1MjTq7EPhod8XvjkEoEtlo6Mliw== X-Google-Smtp-Source: AK7set9jHxDwfZjlYRQImNxlLrJf2PRGNIqpC49lQJ6hQGLIyedzn0Dcgds8P+Odk1ux5IF6z28w19Apnl6+u+KTZf4= X-Received: by 2002:a17:906:4ed1:b0:883:2c50:5401 with SMTP id i17-20020a1709064ed100b008832c505401mr1166742ejv.12.1676473126659; Wed, 15 Feb 2023 06:58:46 -0800 (PST) MIME-Version: 1.0 References: <1249162537.4244630.1676386019653@mail.virginmedia.com> <1911575874.92635.1676392609186@mail.virginmedia.com> <559923381.2944482.1676455949483@mail.virginmedia.com> <257116129.2947501.1676457402764@mail.virginmedia.com> In-Reply-To: <257116129.2947501.1676457402764@mail.virginmedia.com> From: Bart Schaefer Date: Wed, 15 Feb 2023 06:58:35 -0800 Message-ID: Subject: Re: [PATCH] Named reference typos & misc. To: Peter Stephenson Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 51441 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Wed, Feb 15, 2023 at 2:37 AM Peter Stephenson wrote: > > > On 15/02/2023 10:12 Peter Stephenson wrote: > > > > On 14/02/2023 20:00 Bart Schaefer wrote: > > > Unrelated: > > > > I kept the loop in the function to avoid a (correct) additional warning > > > > message setting the global variable ref in the loop. I don't know if > > > > setting ref in a for loop should actually elide that message, which > > > > is a completely separate issue. > > > > > > You mean an assignment within the loop, while "ref" already points out > > > of it? I would think that'd be expected to trigger warn_create_global > > > instead, > > > > Yes, and it usually does with normal references, so I guess there's a > > different case here with namerefs. > > "... with normal VARIABLES", sorry, that's confusing the issue. % () { function> typeset -n ref function> setopt warncreateglobal function> for ref in a b c; ref=$((++i)) function> } (anon):3: numeric parameter i created globally in function (anon) (anon):3: scalar parameter a created globally in function (anon) (anon):3: scalar parameter b created globally in function (anon) (anon):3: scalar parameter c created globally in function (anon) % typeset -p a b c typeset a=1 typeset b=2 typeset c=3 I think this is working as would be expected.