From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id BA2FF29BF3 for ; Wed, 28 Feb 2024 06:29:00 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1709098140; b=nAn1ubDVcRWJlYvShrDFDRKEDghJ7AGdJpjmSgQa83VdIx2lQMT4FrDufogrXFoagWujONva/H CzgvOdQke3lqPCVYr8Q378fhohMM/2onYqWdQIyGbh9Q8n+DKfBrxgWszgThc2Mze2PXgAZ393 jp4FnzEYK38FHPD3zXtx0dWoKuYaio5j6SPMgJbAoo6HxQIYa1sO+TDlV6jdEM/baNWM+ptcru Wt9avCxpwd/RaaoGz8+JHtQmbJCQEZrg8u06FlunABvqjKc6tTInWclYDPDOGKn/t7UaEXO3Xt 6qyfhfrRXLHVNC7A6mEPN7+T4KG6sGTSeXyFzQ4hkzZPVw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (relay8-d.mail.gandi.net) smtp.remote-ip=217.70.183.201; dmarc=none header.from=chazelas.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1709098140; bh=DOPr8LFaVBNoyV+g5MHBQT0oMYKJ3KHxJaxoHEf2HiQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:DKIM-Signature; b=pwTL7nHY1B4zJY68LDK2RuCEKzKF7IlX4QCmG8u+5G1eyc108evpgDs/PUXKvw7R0ZxY9UFLFR rhC4RLEtBWGDDSJhAoOXk1A6RGkLXnjxam9tAFgr/uCzNZarNoeA6UeIu4V8korhoW2qS4P5Va Jg8HjYJ3K8um+7KmXnqlUMR9+LNZjz9aM/Fp08IokqFjKwJ7LmyMwxdm7EjSfxUIGN/wO/ghdu 0Ka8Q8G0B8VgEZ1OVwgXM39URNl9zUooDzU8rCTtTcT+3+Mf+kWVbbmgdffMG9jOzrSBhzrIFE kMlZMOHs4eJfR7xFGhi6FsOBem72sglRRsMuVnIuAOGM3w==; 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-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID; bh=paxlSjK2/76YFrHA4F67Ch1iZzBmIKjt1dB6sv7NAbE=; b=BLYY/E2mEMYgK+ICpKY0zuhoXz zyZjBnR6CuenJeRJLFSFV6TspGQ4pOJBt0Aa9OlxZOHePUCNTduY7i+POwNFs4yX4RXURO67SNi9U OX+QSWSLqgUKl2v0kYbh781O5Qx7FFVmc8AcKejO7w1djnYdAtnqgxRvxiwZDRWjmC2k+54Hm365n hfY6euO026ZLp9dK1e7n2V+0yJD/Uu8G0gIwhDWw45KLCETn/Tle1f/eyj7CxAhAByd9akgj77q/8 mMDVsY3kvoDN0WYi4g8162GbqP43AfB61p5Yr7ChypjKTG79ryohTnzrjSS6ltMz7dmWE4w1ocJ8U xVS8rpEg==; Received: by zero.zsh.org with local id 1rfCV0-000Pz2-Dw; Wed, 28 Feb 2024 05:28:58 +0000 Authentication-Results: zsh.org; iprev=pass (relay8-d.mail.gandi.net) smtp.remote-ip=217.70.183.201; dmarc=none header.from=chazelas.org; arc=none Received: from relay8-d.mail.gandi.net ([217.70.183.201]:53913) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1rfCUm-000Pfc-4A; Wed, 28 Feb 2024 05:28:45 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 84D351BF205; Wed, 28 Feb 2024 05:28:42 +0000 (UTC) Date: Wed, 28 Feb 2024 05:28:41 +0000 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: Assigning an array to a nameref "placeholder" Message-ID: <20240228052841.cbfkrk6pkta5z4ob@chazelas.org> Mail-Followup-To: Bart Schaefer , Zsh hackers list References: <20240227064807.xa77q6qjek77nekq@chazelas.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-GND-Sasl: stephane@chazelas.org X-Seq: 52630 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: 2024-02-27 18:10:44 -0800, Bart Schaefer: > On Mon, Feb 26, 2024 at 10:48 PM Stephane Chazelas > wrote: > > > > 2024-02-26 14:18:03 -0800, Bart Schaefer: > > > > > > > nameref unsetref; unsetref+=(foo bar). This now produces a "removing nameref attribute" warning before performing the assignment. > > > > > > I would rather make this an error, but it's probably not difficult > > > either way. Comments? > > > > An error (or forbidding typeset -n ref=var without the =var part > > like in mksh) would make a lot more sense to me as well. > > Forbidding "typeset -n ref" would make using the "for" loop variation > a bit weird, but I'm perfectly fine with an error on assigning > something nonsensical to a nameref. The forbidding "typeset -n ref" would also come with removing that surprising "for" loop variation (also like in mksh) as discussed in another thread. I'm still not convinced we have to follow ksh93/bash on that, but then again I didn't take part of the initial discussions on namerefs so I acknowledge I may be too late to the party. -- Stephane