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 19971 invoked from network); 7 Feb 2023 10:51:33 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Feb 2023 10:51:33 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1675767093; b=CUfre7yMqbs7tD1vDL/LCWK3/3NJOKeNdsvup1TBzLvcGA00Olj+MgvB8XE2pLVv5UBh+MNzfU GS8LtAs86S1dzg+nv50Bqnb52yTUyTXo+a2LEToacRRgoDFLha4A1AKznEWLiowgMb7zGiHMS4 ShTXRV3D5sZS0QeZ0iSMM8o2WQydDVFldFSaXG1C8Fg7qFmsEwyH7pH7YZzz5VTDF0LV7DegIK VcZ8Dcn/E6hD7c79hop/MMkL+1KwHahVUJSMWx6AdaeDYrVpbuNxykymVlDHbYC1uY5BlcXcKT 8goDV4sA1sou0zIx7ihhNrxk4BoV83TtEbxH6mz+0941IA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out1-smtp.messagingengine.com) smtp.remote-ip=66.111.4.25; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1675767093; bh=0/cjNt0ItoyksqLy/swLFoD+hDniI2rLu4qRQfIjfn0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:From:Date:DKIM-Signature:DKIM-Signature:DKIM-Signature; b=VEvJ79I9w6yhb+/BEJaOA2kJkWCtQ6aMwCPX3lH1mNcVOy7peSHvKZWoNtqteg4IgQlP9gMr2u jrDNlfHgY1/Y2jp7Xk+/ObPRhC/aooOXoW8MaLcZosQh0JtlZPM42P7NIgNbtX1tcMWAzaGDHt XcImM0ykltmyyzc+s3mm/7KAIedORoFvVs+3vrCAEvhHZL1CpgbxXM0qkGU1F7+htfrGOxJezG Xwir3Pz/dFQ84NIxfrtPmWURALteNfZ1u1HpCePCmlb8Ax7YTg2qVBBRksmLQA3wiXwSfOeC0g z3TIzHVz4HFLw+LQ3p15GT6+4XuEV/V87QNeeDqoqIqsjA==; 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:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=NcIjuVyg7f6l4Z37Pg9H0GP3h+iGY0K/xuO5uJEcrfw=; b=SXnP6g05r0syhJaCDT1NShjGdM pJ1kSlP19M2b8VXKW55bsqtrnpwJPbNVrqI3QAmS1MVdGC2b/CwUUcTKTVeug5pw3QLcGfm/vOWv7 tLwz4k+UHKrISyyz9r6r+ClFWet7rXs5Fwwz1Ncwmi2/ckhir9hzzY2pUMERpselP+cGCyjgauySc wbVqlniX/4qUY2/D95MADsvXVKqSvAoSPSprqcK+zr+eUlScOsvEdh/Y1ChU+4x4NI/bnZezGXF7M A2XnrM57Omr2Dv4/cpezeIyhXbL7ReUQNTpYQPhuA+HE2lC/zJWBe/pVqLhA3xi+4YcODoN8XSl3e VeFD62/Q==; Received: by zero.zsh.org with local id 1pPLZQ-000LnR-Iu; Tue, 07 Feb 2023 10:51:28 +0000 Authentication-Results: zsh.org; iprev=pass (out1-smtp.messagingengine.com) smtp.remote-ip=66.111.4.25; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm3 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out1-smtp.messagingengine.com ([66.111.4.25]:37981) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1pPLZ6-000LUS-Ua; Tue, 07 Feb 2023 10:51:10 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 681D35C00F4; Tue, 7 Feb 2023 05:51:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 07 Feb 2023 05:51:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1675767067; x= 1675853467; bh=NcIjuVyg7f6l4Z37Pg9H0GP3h+iGY0K/xuO5uJEcrfw=; b=Z pNQLbZYhCtlCnsojB3BC95ywLwNu/qE7IKwxqFZ11wE0z1ufp+tKT8w1bpIX2QVA jYyF+0nJkQ3RJGo3crSMrfy6nQWExo2Q7n522ROPBuvjKDgDNVCyYqSHVnb1hsvb ws8akBd4gfKzUJhm+19SnidaP4TtUeAAu4dh9bbWcHiJVhkH7g3MstMhdGXKbYTN mm7nY4MFYwUPDS6ImnT/fWNdNT0aCSOW5+M8+5njqr/3Wkrdkrgq2PUQX7QMoaa8 ioZtbwbLyvgkqH0QC6poAktcDHfVTjzUFBsZjBowQF/uJemNrxu80arGlQfI+OT+ hWPq9z1+f5QCSNfn/dYbQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1675767067; x=1675853467; bh=NcIjuVyg7f6l4Z37Pg9H0GP3h+iG Y0K/xuO5uJEcrfw=; b=cuaMQVyx/MRsxKGjAH0QU5u0IXuACGm6zqoW+P6/JvBX 3J66LAh7rlKlpaY5RBKCnV3aQLAhLiIMNOkdDoyoxX84DvAM8vaOZEvDyuQPKxRB IlLLUpN9nishUwUDcDo2pvl2qtllvv1NA+tVBSDd/1eSDxXMcaZMR2EHQjNErHdg Q3xAfY7aZ7Dv0UVuGEGJCO7aw8jDH8nYqxff6QrGLXyW8yf0OYrIUZzQL3mY2gIJ I4Rq8ccPyt3slkp10xw6yH9WR4Qj6ESB9V3jtSKjofKqGtJb5NU3b3jkfDwR+bSF O83r1yjCYA9Bk4Njzoin9Zsj+2xkcxvVTj5uxbS5JA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudegkedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujggfsehttd dttddtredvnecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggrnhhi vghlrdhshhgrhhgrfhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeeuveekfeffueefhe efhfegffefvdeitdehtdegleejledviefhveejfeetgedvkeenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhhrg hhrghfrdhnrghmvg X-ME-Proxy: Feedback-ID: i425e4195:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 7 Feb 2023 05:51:07 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1000) id 4PB0Kj58zwzpn; Tue, 7 Feb 2023 10:51:05 +0000 (UTC) Date: Tue, 7 Feb 2023 10:51:05 +0000 From: Daniel Shahaf To: Zsh hackers list Subject: Re: [PATCH 3/3] Documentation for named references Message-ID: <20230207105105.GB14216@tarpaulin.shahaf.local2> References: <20230207005647.GA5789@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 51372 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: Bart Schaefer wrote on Mon, Feb 06, 2023 at 19:25:03 -0800: > On Mon, Feb 6, 2023 at 4:57 PM Daniel Shahaf wrote: > > > > Bart Schaefer wrote on Sun, Feb 05, 2023 at 18:26:50 -0800: > > > > +tt(-n). The var(name) assigned-to may not be an array element nor use > > > > s/assigned-to/assigned to/ > > I did that on purpose to remove any ambiguity about what object "to" acts upon. I see. > I've used s/assigned-to/so created/ +1 > > > +When both a named reference and the `tt((P))' flag appear, the named > > > +reference is resolved before `tt((P))' is applied. > > > > Add a test for this last sentence? > > I can't think of a way to do so. Given ${(P)ptr}, there are two possibilities: > 1) ptr is a scalar, in which case we're not testing the right thing > 2) ptr is a reference, so any other order of expansion is meaningless > I'm not sure I follow what would be "meaningless" here. I guess you mean that ${(P)foo} requires foo to be a scalar's name and expands to a list of words, so trying to expand ${(P)} first to a list of words and then treating that as a nameref wouldn't be implementable. Is that what you mean? Anyway, would it be worthwhile to add a few simple tests of the combination of (P) and namerefs? I have these: pointee=value typeset -n nr=pointee myscalar=nr echo ${(P)myscalar} 0:named references with (P), as ${(P)name_of_nameref} *>value pointee=value myscalar=pointee typeset -n nr=myscalar echo ${(P)nr} 0:named references with (P), as ${(P)nameref} *>value (the asterisks are so MUAs don't treat the ">" as a quote) > If ptr is a reference, a working test of ${ptr} implies that ${(P)ptr} > also works. [...] That doesn't seem to be the case in the following: % ary=( 'bry[1]' 'bry[2]' ) % bry=( lorem ipsum ) % typeset -n nr='ary[2]' % echo $nr bry[2] % echo ${(P)nr} zsh: bad substitution I expected this to expand to "ipsum". I also expected $nr and ${nr} to behave identically to each other, but: % ary=( foo bar ) % typeset -n nr='ary[2]' % echo ${nr} zsh: bad substitution % echo $nr bar % > > > WDYT of documenting somewhere in the manual namerefs are new in 5.10? > > I was going to add something to NEWS and README eventually ... also, I > wasn't sure we'd landed on a version number yet. I suppose (once we > do) a mention wouldn't hurt since the docs are likely to end up on > line. That's one argument, yes. Furthermore, I think stating version numbers would be useful even in the locally-installed versions of the manual, since someone might run a bleeding edge distro and write code that targets LTS distros. > > > texinode(Parameters Set By The Shell)(Parameters Used By The Shell)(Local Parameters)(Parameters) > > > sect(Parameters Set By The Shell) > > > > s/Local Parameters/Named References/ > > Thanks, thought I'd caught all of those ... it was nice when the older > version of yodl complained about those incorrect references. The yodl macro is a thin wrapper around the texinfo macro. Perhaps texinfo warns about this somewhere in its output?