Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc:content-type;
        bh=shUSc3Lyj7MjI2cMTFNQu4KmjCYUNKHYjc7yGpTXhq8=;
        b=z6ojNz3fwC7oeHQtLBUu5+ovPvOti5PXHZAlhdCB4UNLgU5z4xtt69pSyusE6trwd6
         3eltUqSGWOG2LODkeGz8n2q1+8acHhBvm8G0OcGKKbA73gzRB0PQB3SeanJuoipumVep
         hBd7XQjSqF+Y00+qwl0hcsPp+40Sdk5HaDa4+YZLMsrBjiu9f6WCqWsh3uaXH4LTiv/u
         ySXJHE6dpGMJ6Ymw3mFNQk8KW7BNKQxIn8hH6nvGbGqjf/PXvvPy8fiCJxnILy/q51gN
         ojy6hbAjcawRELOnX5FnqKP/6DVKAW00ydH3EfFSxvs4Pt92BdLRRnnB1oUcbuKJlWVK
         I9YQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:cc:content-type;
        bh=shUSc3Lyj7MjI2cMTFNQu4KmjCYUNKHYjc7yGpTXhq8=;
        b=A0PSCBwO83jXlB97SEFsLj+Lj1Wpz9dptisafiIJfTE/pesUq2retHT/2a76gZ4Jj9
         i0KK0u+G/d7d4o+CnmMVNrJAk3n2KEuRbSmWHqZJZlpeZfoIWgwKHDE8bApd16JRzdyj
         t9VygdjhZ008TYcmsjG5ijtkqxwycC1J2ZbpBEKia8uRHLhW9SPi0lopnlN4J2GYBC4W
         aHI50DNRu7xllE1Wm5ZqEHpYTiSvwiSgcgoNnq3ji2eSePI5C+hcmYZ9ylY+wg5CLtDl
         miGLVG0JsnKGl4ADcS+l9wxYVJPXwIVrMqAszkEwhs3VZqgtHKeDiDCq3ZrA8UJK39TS
         31EA==
X-Gm-Message-State: AG10YOTCYtHDOFupLABQzKihWPoCP8W55As/tlHZUMPZamdt1xnLy2zjp43LZO+AAnr8Wbk8IlX1CurbcRzXAw==
MIME-Version: 1.0
X-Received: by 10.140.178.195 with SMTP id y186mr19417914qhy.100.1455519092912;
 Sun, 14 Feb 2016 22:51:32 -0800 (PST)
In-Reply-To: <160214135247.ZM3326@torch.brasslantern.com>
References: <20151230104531.GA20496@linux.vnet.ibm.com>
	<5683F898.7010907@inlv.org>
	<20160205100902.GA14979@linux.vnet.ibm.com>
	<20160205102735.1f09973a@pwslap01u.europe.root.pri>
	<20160205104444.2437ad33@pwslap01u.europe.root.pri>
	<20160205160236.1274aa5b@pwslap01u.europe.root.pri>
	<20160205222750.1fda3574@ntlworld.com>
	<160214135247.ZM3326@torch.brasslantern.com>
Date: Mon, 15 Feb 2016 07:51:32 +0100
Message-ID: <CAHYJk3S=saLaYHy-L+D02Wc=172cFRDpB8wXs+mZteETay4Qmg@mail.gmail.com>
Subject: Re: Assigning to $0 (formerly: PATCH: funcstack[-1])
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 37978

On Sun, Feb 14, 2016 at 10:52 PM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Feb 5, 10:27pm, Peter Stephenson wrote:
> }
> } By the way, looking at the code I just notice that the following isn't
> } an error even though it doesn't do what you presumably expect:
> }
> } % setopt posixargzero
> } % print $0
> } zsh
> } % 0=foo
> } % print $0
> } zsh
> }
> } Maybe that's OK so far, but you don't even get the value back when you
> } unset the option; it's silently lost.
>
> So what behavior would be preferable?
>
> 1. POSIXARGZERO makes $0 report an error on assignment (read only?)
>
> 2. the value is stored and reappears when POSIXZERO is unset?
>
> 3. as (2) but a warning is printed?
>
> As another by-the-way:
>
> torch% print $0; () { typeset -g 0=argzero; print $0 }; print $0
> Src/zsh
> argzero
> Src/zsh
>
> So typeset will accept 0 as a valid name and -g as a valid option, but
> can't actually set the global $0.

http://www.zsh.org/mla/workers/2015/msg01400.html Some time before
that patch, assigning to $0 was always possible, but at some point it
stopped working.

-- 
Mikael Magnusson

