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 28323 invoked from network); 8 Feb 2023 23:19:05 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 8 Feb 2023 23:19:05 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1675898346; b=NapbGYzBNlCqAANluffs2XEYK6J+LUe+986as6WsCjlh4pbNo/7zqX3QtbcFva1nhQfY7pyG42 QEvnf/FhSy+b5GikCOmIsrdeX+2Z2FClrWaMPpAJMz7Tb0SQVUAPxXIhrWya/KiWUE1+Tictdd nJ/sajFT/sviVJYEJfOIxAdoIdAet9vQDduGzHme3s+R88wvdkmY508uTdXXu07ILo0b+7fm/g eH90RtjLh29LmEk+Nm1AjhGcvls4y3MfVDJpSZb2A2hUZaBte8jxkLje4mBtrO4B3+cjegzY9t 7XBoGK65uHMBlBmoIYvEIAvgAc4E5aqkmVXGAy6s6F+xsQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f50.google.com) smtp.remote-ip=209.85.218.50; 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=1675898346; bh=0uw82NFn78vrf9hBZ8+6VnQnAZYc8rhz6nsQvrjTbZ0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=H0aNNGOgzK0c9+Oi7tdlURhmfkyb6Q/4P3lCQ2YbQP7bP3YswiZPr2OVFwmr5LO8j5abbVDWUh CT6ML/MuzXuLEHcZq8u+uE/VrvhEgzZ++58Ohin0fg6pmaLE0S8gW9kWLIcRZhcO+dRYUOUnag qM7DdjhjDUSfoZAPIec9VX3L7DKZ8YU/wfKydv6dradLU8oI5STWr+GrAyD5AEhNRX7tsMzxCk DwNLbtpRhFWnIF8b1DhmZDJXdwqagobbLSt+Tb/RLu+U2eNAZVU9T5UfhByVVbEr/LGsJlWDmn wkSnaJtKdwSpRqNvE57GI6UlS4uTbtRApae3wwVU3evRRg==; 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:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=PMKQDNIDk8UyFBUbTvV9CkEjb2DLPZ5N+Xkk7itp1jM=; b=EOqvQIv9WGryff/If8WISpGTSi lhj5T+5RchzzTu40u2PoQQAQNZXaJ8AiDiVgneWyCqfhhOnDuTtPlR+kZE5DbzJ2wdYWPYhfnHjvE RztmOMpehIR+1r0QjrE0PKsYKWZiYMnHdzGdW693Wn4TI2AFkoQUjeGLCRLT4Saa6B79ioy2J7p9U 6db+rv0JxdZUzEeyyxpfIDgcTOYi5U1s474t37I30RbMBcFHPyNJvjfPFTLLZ3sg3UXEhS1DhgmpY CXwtppd2MVqORUUhCdd3XYEvmUBT7ptH0Ze7qfaz3PkpT/ZnfF4s4B5LzTNPu0/F+mcmvtiu+Eujs eV/vp9zA==; Received: by zero.zsh.org with local id 1pPtiS-0002xJ-Nz; Wed, 08 Feb 2023 23:19:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f50.google.com) smtp.remote-ip=209.85.218.50; 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-f50.google.com ([209.85.218.50]:35514) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pPtgP-0002br-Ne; Wed, 08 Feb 2023 23:16:59 +0000 Received: by mail-ej1-f50.google.com with SMTP id qw12so1523900ejc.2 for ; Wed, 08 Feb 2023 15:16:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=PMKQDNIDk8UyFBUbTvV9CkEjb2DLPZ5N+Xkk7itp1jM=; b=J2wvq7y2C2yVkJMwcNXtLON75dKx+HVlMcs9ehzibivmFcJK/YflHGDJEb1ArnPavr 7RKjJ7UIBj5ZtpVSi6eZBld22ioNeEOMqeoUiL+/YHgBSWtI5WnazZSY7/G1jEqgM4jh VGBAcLSizPSZ9PQLgqoldjaBnqaLiVfYCZkUu0AW8FnMTigROZZtF/OWxZGs2auJ71R0 VsDoK4coGPgIhXBcYPnUNuv7edBQ+6pw4tskbSEa+i5YxJmB8VOckqrPUNzHWmHTd8Uf dNFMvKGOyCPtQqmlahZWMtGOJgNVRFDO7YXsvUqzRNGyqHagfvx/+h3qK+6m+9ROcaAD blNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=PMKQDNIDk8UyFBUbTvV9CkEjb2DLPZ5N+Xkk7itp1jM=; b=zzGgKl8gdPkfrlOyVd1+CYnRNbOxgp+4TjucmHqXeo1eV/xOFA7s6HviBIGb5eku7W Uhbm0KKWAIimezGo+CIG1pBSt53B8C7Jv+An5iNYyvPd46VqGdHFHyqGQ6ExXxR2fpSY MQhs/+lItnAgLvKOqzDhf9ZU1a8UdqtOiNMYcgY3RMVNSgrofO2hB2Q1cdwQo/EMrCgt KyxTX7Al8uZwws5cudjeFugNmYZuTUpqiXHPosM/TI8BHWZqmkyXwpvaNtyM7SkzZ5YT X7crZYtnyj6h4b4jR/n4EZSQqfA3YR3TXCfg0JXbVCXcM6NYTslmaIX3z+seAajtUYbc w2JQ== X-Gm-Message-State: AO0yUKVFM0vseKDPDMMS0/+5XI5Tu+6OE/E+F9jJ0h9ufUgJeMnma5aJ Qw8YuX3+vLoEivtFjEELkrvBz3JS9Q2rvdQX8uizh4pvEi74Ww== X-Google-Smtp-Source: AK7set86eZusInQM8yuijYc96QS1+8sE8rvlMv0csnB0a8jayjYtGqxZAqrLDFJviH3/C/WoxfEFU3JAp73yh8VqnTs= X-Received: by 2002:a17:906:7154:b0:888:dc91:ece6 with SMTP id z20-20020a170906715400b00888dc91ece6mr81808ejj.6.1675898217362; Wed, 08 Feb 2023 15:16:57 -0800 (PST) MIME-Version: 1.0 References: <67689-1675827940.088548@BxvG.D9_b.7RzI> In-Reply-To: From: Bart Schaefer Date: Wed, 8 Feb 2023 15:16:46 -0800 Message-ID: Subject: Re: [PATCH 1/3]: Add named references To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 51384 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 7, 2023 at 8:59 PM Bart Schaefer wrote: > > On Tue, Feb 7, 2023 at 7:45 PM Oliver Kiddle wrote: > > > > The error message from, e.g. `typeset -Z2 ref` is "can't change type > > of a named reference". > > Hmm, yes, that message should be changed if possible. It'd be more effort than it's worth to distinguish the type of array involved, but my next patch will change this to say "of array element". > if the current locallevel were visible (cf. new special) then something like > typeset -i $((locallevel-1)) -n up=argv > could work. I think the current implementation of argv breaks this, tho. The up-level argv is a char ** scoped to doshfunc() so it'd be rather icky to expose it as a shell parameter. > The special behavior of namerefs in "for" loops and implementing > "unset -n" might be good; the latter isn't mentioned until the "unset" > builtin in the ksh93 doc so I missed it entirely. Next patch will have both of these, too. I note that execfor() has quite a bit of room for optimization, but I haven't dived into that.