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 25100 invoked from network); 1 Nov 2022 12:08:29 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Nov 2022 12:08:29 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1667304509; b=C/JDhqvZuFu/oG/x4OmxEBVPVIPJmYtpZQBGtKexXx/y1aI2MfM14e22m/F8hLo5ylxzAJVo51 FhmJL1uCVm0LnEGun5wjUZ4W761OSIotvX5v11zENvkSm+j0DxAz8cFmQ3fvRRxHgLf7MQWcUc gjow+2zIqtzEPzATldx6Jjzny9yxR/SkSElGgj7a+9TBKimmwDkLwg0lcyn1hYBFZYLZUuLwS2 4kEj4uU17ZFKZUE0FX3sAK1rKCa20Nr5U9ApdcC1O6Dha3bGJHJ/j2Riyhg/dsaKkBO06zm0V+ SEZEzWqoOJIiIrguuKgv7BSskCBEBgL5LR8y5hwQbtFFOA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1667304509; bh=oa8a2cCMDrZt7nbNJH/InYxwUCGcJ5m+cKfjqEtLzy8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject: References:In-Reply-To:Message-ID:To:From:Date:DKIM-Signature: DKIM-Signature; b=R96X1lRKDQGROvacfzA3mqAELvwm5v9WYXnlOu1dAbVCc3sbtPt9NDzVfxC0rDVuR0Z6dwLKcP ehkD6jT0l8Y2JYg2JSvBMkWpGy0emGwKVuHYRH8GnBtnRr8Qs4Rl1pw1U7PX3K9aKM4Isexq82 nUdyFJXEBSrcNbl/AOTmBu6JyMsiuVXtesJDr/ogGQS/aJXl5g9y6VJ6WdSozWiYAgICiZJykk zhgRGWc9mb6uB67rXwJ1HD/otaoj4wYXO1zmyqEl/JVqSGLZP+TygmWnf34BVZ0NmO3Mq85kk4 3PdmqLU5BD9KNwYgAh+Ykfx+BCxy+tRi1YM/XvwKWNdxSQ==; 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-Transfer-Encoding: Content-Type:MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From: Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=HDJ3/hozjgAIOZkj5qFeq6wECfXOc3nwk4ujwV8eeuE=; b=Lw6K3YUMBLRjGlbNxQZC8tIuJz iOvDQkWbW9XpY2vzBV92sDHNwT4cJ5I2TsMm5B8vcSxFJ9e0XLiep0aBSkUgJXac+dlFOlF24/Whq btv3QF2QYziaT5csdBXNUEewNYsqRSp2n/bF1A+wl/Vbm/tW9DfOcz1D+pFvEilfeMIh9DcU38Wnw ilKbyknzVfzwHPZotjWy/qcT7MUP/nkOdxKLHzp/HEvaUZRrjNH/etUlBhxT1nS1L8r5mZjEW2a79 CxhjAhf74nxgH+6YTGQ1IydIydSmmZAH4LbjNWRvCUK4uWB6Xv0Pj8v/5LEuzuKsA+R/vZrT6B4e0 53aVEI4g==; Received: by zero.zsh.org with local id 1opq4C-0000BX-DG; Tue, 01 Nov 2022 12:08:28 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq2.tb.ukmail.iss.as9143.net ([212.54.57.97]:56690) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1opq3J-000PUG-Mc; Tue, 01 Nov 2022 12:07:34 +0000 Received: from [212.54.57.82] (helo=smtp3.tb.ukmail.iss.as9143.net) by smtpq2.tb.ukmail.iss.as9143.net with esmtp (Exim 4.90_1) (envelope-from ) id 1opq3J-0001mD-8n for zsh-users@zsh.org; Tue, 01 Nov 2022 13:07:33 +0100 Received: from oxbe21.tb.ukmail.iss.as9143.net ([172.25.160.152]) by smtp3.tb.ukmail.iss.as9143.net with ESMTP id pq3IoNPgAsyQZpq3Jo1nBf; Tue, 01 Nov 2022 13:07:33 +0100 X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-users@zsh.org X-SourceIP: 172.25.160.152 X-CNFS-Analysis: v=2.4 cv=W/8r6Dak c=1 sm=1 tr=0 ts=63610c05 cx=a_exe a=I3kh1BFku3bnNore5KbC7A==:117 a=1DWFKdCB1IcA:10 a=IkcTkHD0fZMA:10 a=ZjyAdWuDOD4A:10 a=q2GGsy2AAAAA:8 a=_uDS5245xcwbi7JEjlQA:9 a=QEXdDO2ut3YA:10 a=z9dJwno5l634igLiVhy-:22 X-Authenticated-Sender: p.w.stephenson@ntlworld.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ntlworld.com; s=meg.feb2017; t=1667304453; bh=oa8a2cCMDrZt7nbNJH/InYxwUCGcJ5m+cKfjqEtLzy8=; h=Date:From:To:In-Reply-To:References:Subject; b=c9A9eJqtd2Xzyxc5IkZke8XtTwRalAERLnCEWqP1K3EM7ZVUREHHZDJ2tSoZncaXs 9ktRd5qZ74b3gE5xaJppAVdqKiTnmBUDkbEzD/vSqNkkQ4cWO87211l1seYVFe3AS5 uhZCJiqJBKd5/oE0re1EWeP7+IL5WkWN74U72pIqZvBzvbv62SVzFDxQGGveEY2bDu 7c7yxxQwdcda1UenVBVGecJbGWrO4rEIFba/qcYXFESpzJ9EVuqpyVKutOMffREUnd DBS46Z+enuz4j6MEYs264xRWFjkXzqMdNMkEugeJ+TmBxDlanWAOkLyGc0Y+vv4H+s 1jbcPXw0QOIgA== Date: Tue, 1 Nov 2022 12:07:32 +0000 (GMT) From: Peter Stephenson To: Zsh Users Message-ID: <1742037247.4104297.1667304452985@mail.virginmedia.com> In-Reply-To: References: <5f18c162-e111-21ba-3ebe-ece09a477ecd@eastlink.ca> <552657de-31ce-255a-bc8d-7c9cd4b8eabd@eastlink.ca> <530b18d0-5e72-6afd-7448-cdff9c119bda@eastlink.ca> Subject: Re: "typeset -p" inconsistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer X-Originating-IP: 147.161.224.167 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4xfA6ggj/7mASIGS5MpacbBndNN8kQ3pJ1j2iUkifqtNl0UDuuqlHb1t43Yn2s3Bw1mk7AsFtCqkQUg7SUkkpo4de/+Osa+lqi0YonuBqNlhDalNbS54au eRueJiZzUDBtsYEo7z7anrAFiKW1ptEBuykI41YbhovAry9yt/PKaJu1AZG3korO0RI3WH9rgfNO+hinZbZ+V3+d/uwS3Xk1OSOi5fX8WuhvP24L9umMlP9y X-Seq: 28309 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 01/11/2022 05:00 Bart Schaefer wrote: > % setopt extendedglob > % typeset -U CDPATH > % typeset -mp '(#i)cdpath' > typeset -aT CDPATH cdpath=( ) > typeset -UT CDPATH cdpath=( ) > > Note the -U attribute is only retained when printing the assignment > for the scalar ... which is literally correct, since it was only > asserted for the scalar, but lossy, whereas the array-ness is > preserved in both cases (as long as typeset remains a reserved word). That does correctly reflect the behaviour of the -U flag, however. % typeset -T FOO foo % foo=(one two three) % typeset -U foo % print $foo one two three % foo+=(two) # flag applied % print $foo one two three % FOO+=:two # flag not applied % print $foo one two three two Other consequences of this are logical, e.g. "foo=($foo)" does prune, "typeset -U FOO" works as expected. The ideal output for typeset -p to reflect how this works might be to output the typeset -T separately from any indication of any flags set on one or other of the two interfaces to the value, i.e. something like what I typed (but with the current value somewhere). typeset -T FOO foo=(one two three) typeset -U foo pws