From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22739 invoked by alias); 15 Feb 2016 17:12:32 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37989 Received: (qmail 20240 invoked from network); 15 Feb 2016 17:12:31 -0000 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=7RM9Gw7+oV8BFVqWA5FqXWXXEPL0KMWbjm+uJvxTZp8=; b=cnQ1tXXBrdmUdg3e5FaN+6wFRrkq7k6P/7mN5aRuTU3ms6TUtYXBMlTq3Y3hGfiI30 KzFGRdtS/T9ros3TiNHULCmKeImPMpDt4bmybsz/BuNA3VEk6+HmxB8q0Dnu8gtmU8jS hXUt3Vy8xvRlfikPH2Mw26+87QsWWhpepOJszTDbzKPhxF+bNRkUcAqCh7wrH5LDWbTG 1ktCaxC8yi8FNOyd4IT1Eu6WHaZiOcrCTLyaWLmGlkB8bsfDFHqGT0IgqLiUPckySiRk xbB0aHKOWriFxVH8samrFYpOgs/d+7DQqUpe1vpOwevoCQXV455bybQfkIHSC8BFh5C+ flFA== 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=7RM9Gw7+oV8BFVqWA5FqXWXXEPL0KMWbjm+uJvxTZp8=; b=VjiVAHcJq3l8VI3oeQvKbF6VeHBeHhhJiOTzC82bvsLerazDIR8s4xlSoGvJ0aM6ss 9k9meXLCXJWIWrVyYy2CYQnlUgSGwdlR2IKVBHYfjLpj01rAN8XkfHiniQEeBR9FTVQT gdrVBJ53fMMTg/9/EEvRtwewglbMn4JdzL/ImHfGPox7LCUr/IzbfOBjL7vCl+rJpFJA FtQ/qHDVPPZDjurNOABBKNgWfoe/MGu4o3KStfNM/v439LcR+v8HMEwm/uc3vNo93Cu1 xZ8Z6IyEUFtiRpzIVkOhFtXSFvijKIiKucpcjHV2w55XSIhVFhEyX/u28c2c54PS11Hj OtjQ== X-Gm-Message-State: AG10YORhERzlENIA1luLqaEAlZK4+5/GOdXHGLFhB0IGMa70M69v0PoEn7a9601h3QZRjygZuErUOTXOKtXJEQ== MIME-Version: 1.0 X-Received: by 10.140.156.212 with SMTP id c203mr23232318qhc.96.1455556348821; Mon, 15 Feb 2016 09:12:28 -0800 (PST) In-Reply-To: <160215090839.ZM27409@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> <20160215091734.320ad457@pwslap01u.europe.root.pri> <160215090839.ZM27409@torch.brasslantern.com> Date: Mon, 15 Feb 2016 18:12:28 +0100 Message-ID: Subject: Re: Assigning to $0 (formerly: PATCH: funcstack[-1]) From: Mikael Magnusson To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On Mon, Feb 15, 2016 at 6:08 PM, Bart Schaefer wrote: > On Feb 15, 7:51am, Mikael Magnusson wrote: > } > } > 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. > > No, I think it was never possible to assign to the global $0 from inside > a function. > > torch% print $ZSH_VERSION > 4.2.0 > torch% zero() { typeset -g 0=argzero; print $0 } > torch% print $0; zero; print $0 > /bin/zsh > argzero > /bin/zsh > torch% > > This is because the "argzero" C global is handled independently of the > usual parameter scope code. Ah, right. I must have assumed on some level that we were talking about a function-scoped $0 because I have never in my life wanted to change the top-level $0. -- Mikael Magnusson