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 8945 invoked from network); 14 Feb 2023 20:01:42 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Feb 2023 20:01:42 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1676404902; b=k7YgcDYgInXRBgQ1REGcPmXKW1YigY2zg3DMeXw040B0D3bBY9UABvMovcTHltFbBM5Lls7+i5 RiRBL0+Qqd5DNKrOO+7bjrOIgTAg5U8z+RhmbYe5YXeTLKESxItlNH54m/+ZibdnCVl37cyb+1 aNWiFGF89t3h6nD8bT5x7dZ2AdwSt+npMyHuVG/DxemARM7dthQ67yGmkPia4jMSNoNWMsWr0n /tCBVwOQGjjKqVBoE8nzs6R+0AaC9P1u64P8qBKq/Hb34YHjVJb0ynLgOnJxwROBV6DXkYxNCe k0p2KzxuUEtREnlaupEIc6f4kmN3/Y7msvEbAWqLJb3wLg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; 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=1676404902; bh=OkdEewfM7zZIvrE5KxYS4o/tYWgkWgi2Lmu/MBfAM78=; 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=ZOw/an4Exvj/bKp6qCeCrOCNtCBOqOxF+DjFEDOUDIB6EjvM66Fetz3pcQIjpRefgLUoIZv60V hOrOSQj85V2Sq9jNdTSv1Kc7nj7MuZutXJvUk6sA9/ZpbekjXA71MCAe4R23DHSPF96QNu66Ky 4jqykHZxIWaT/vG0Qx+4DQN0Hm+Tmkw/nIRsGmIkYFUsth2GMFQLQzvpxOwmQyiDzJfHatJYxn hc34mB3x0HiDlq2q/FhPa6xuFMuN0tqVq54HW8IdvsSflGX9/ijxcD8/Is83iLpef/K0Wco/eI 94D1+ftYvxkU6Hv5ZRgFLYFN0pR/jJ22QqIduinktbm9hQ==; 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=E+DGKh0+/laMm85F3YV29MEe8HyqzwwbbQZf0J7hvak=; b=UYgWFhbkmIeM5foJCqFgJaJpfg oxjYl6RKKkMmfZGQFQhzejvjyqTTjpwh/aM4OGuNXQlE0wcwOBg9dyLq3DNDx+gpXQz+ExP92gl7H qbYSDV0XM4BWlFkWyqUBPTNqb7OkWxMr2WiZSaT/TN7nr9rBSvf8H89LFP4d4jJpAmgeJXps5NE8K N7ufDO4UrDJnru5PIpczcpEx7rGDa7bz3qjCQ7hD+r5QVxOZ3vZ2r1RWE8lKiY5jfOnG64h3KaJ3i j6z7c7128Oqfp3Cp0h43iUQj/CorjegyG8EUV9lEOHyWYjcn8olNzK1dm7ecK+KbzNm5W5zTVZm9n Zx0mA+9A==; Received: by zero.zsh.org with local id 1pS1Ui-000GNa-Ch; Tue, 14 Feb 2023 20:01:40 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f46.google.com) smtp.remote-ip=209.85.218.46; 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-f46.google.com ([209.85.218.46]:33772) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pS1UA-000G3x-GM; Tue, 14 Feb 2023 20:01:07 +0000 Received: by mail-ej1-f46.google.com with SMTP id ml19so43036673ejb.0 for ; Tue, 14 Feb 2023 12:01:06 -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=E+DGKh0+/laMm85F3YV29MEe8HyqzwwbbQZf0J7hvak=; b=4OdwyLeQfN01JIEHFP5tdbiIGas9m2/Zd5yCcJd1VmXFE3gxJP6JX3aGMEvMHDgctj wvFb35Ze21fzg/PPyjMx552AcmO67ijgS21FLPluKKwDppc5hP9sDngEhuyjZruc1DXK fRpOz1pDqicSHUb0g+isLip1EL447x/WERTVJ3YYs5ea4K4NmtrCwuYHjI5ZuKd13FY7 Oxv8qrmqOGboOawxGlA3oL5+D5mQJhJ2CbFpbsFuMW1ybR9d05N2K5iscVGMJe3RuYsw cm3JnjpJtXQYHKa8HwJ8Xn/mz+rtdLANyojAQYNcH6oYbTvbHGEtLiZF4a3y39joczwC Pp0A== 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=E+DGKh0+/laMm85F3YV29MEe8HyqzwwbbQZf0J7hvak=; b=hjFPoF/8TyjElcOwJ07GGbRGO6LdVImnA4TF7ttm7GuOvq1kX/+vvb+e2rgTD6djgs FpwKHaA8sJYsqRkaj9pKHFiq5ywJpNGG2g1NgOMRVm2zJc+YiIlUKD7IxQRBzyv1ztGP 1Cru/bLH0EgaLCNdRKbd3YtuIpD2vW2/lFzZBpc6bWra6fMT+2OKEuADmank6U/E5XKB nAjKpFuPGYgo0COIGxRO8hTQxROQ2OnGAnPHPDl9j0WVGh/BMIaypanA8bo5tN7mct/Z KFrgO6IZVXiYyS7v5k3s/LMH+eDLOMM3DYy9ZnJzHlAtVHBLRuVhtpUpE1FP6djjngeL POgQ== X-Gm-Message-State: AO0yUKXe6D20OBI392iKLzgPCpvCDPTIRHlY3uz9BXH3iMKOvI25Lwq0 vD417O8xZ3KMqk4Vi9vVAlxwd2R+cILYi+OcCvZ80Q== X-Google-Smtp-Source: AK7set8ZEfcVs1cITFVU7No4JA1FJVyEoRKD3SZcOki2FCUCx3If8tBnbipLXqHIqcFK9uZQUoGJY2g2OV/kbyKmpLo= X-Received: by 2002:a17:906:d8c9:b0:88d:7af6:25de with SMTP id re9-20020a170906d8c900b0088d7af625demr1838838ejb.12.1676404865959; Tue, 14 Feb 2023 12:01:05 -0800 (PST) MIME-Version: 1.0 References: <1249162537.4244630.1676386019653@mail.virginmedia.com> <1911575874.92635.1676392609186@mail.virginmedia.com> In-Reply-To: <1911575874.92635.1676392609186@mail.virginmedia.com> From: Bart Schaefer Date: Tue, 14 Feb 2023 12:00:54 -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: 51436 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 Tue, Feb 14, 2023 at 8:37 AM Peter Stephenson wrote: > > On 14/02/2023 16:14 Bart Schaefer wrote: > > > > I get a passed test with or without the "unsetopt typeset_to_unset". > > > > Is there some way this could be platform-dependent? > > Here's a minimal case: I can reproduce the (lack of) error message with your minimal case. Gets odder. I added set -o to the test (otherwise exactly as pushed) and the output includes +typesetsilent off +typesettounset off +nounset off I've no idea how/where it gets turned off, though. If I strip down K01 to just that single test, the error message doesn't happen (test fails). If I make setopt into a wrapper function in the %prep section, test fails, but I don't see any change to that option emerging from the wrapper function (directs to /dev/tty). If I remove the setopt from %prep entirely, the other tests that rely on it, fail, so it IS set. By binary search, I found the option state changes for me after this test: typeset ptr2=var2 typeset var2=GLOBAL () { typeset -n ptr1=ptr2 typeset ptr2=var1 typeset var1=VAR1 typeset var2=VAR2 print -r -- ${(P)ptr1} } 0: >VAR2 For which I forgot to write a description, but it's supposed to check order-of-evaluation for namerefs and (P). Running that test standalone does not cause the option to change: Src/zsh -f =(<<\EOF setopt localloops () { setopt typeset_to_unset typeset ptr2=var2 typeset var2=GLOBAL () { typeset -n ptr1=ptr2 typeset ptr2=var1 typeset var1=VAR1 typeset var2=VAR2 print -r -- ${(P)ptr1} } print $options[typesettounset] } EOF ) VAR2 on I have no idea how to debug this. Thoughts? I would suspect it's more related to the test harness than to the named reference changes. I tried removing the EXECOPT frobbing around subscript evaluation, that made no difference (except for the test specifically about that). 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,