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,T_DKIM_INVALID
	autolearn=ham autolearn_force=no version=3.4.1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=brasslantern-com.20150623.gappssmtp.com; s=20150623;
        h=from:message-id:date:in-reply-to:comments:references:to:subject
         :mime-version:content-type;
        bh=JG1rddQhATWaS/RNKWnHklASRONK/RyVBEzJH+As9UE=;
        b=nkPMrOVy/4zn66/2jRazmowFLqcHPJ7xZnwaAjGkRWBOmi3wEcEBWIWxeUMz2MYber
         lZUV86Vk1+terCkYvSvQmrppS6lKNDX1yblBXUNlndu/fzSC8CBbGYgvbNCCtUbr8DiI
         Rmed+9xqCHAsQH8KFRrnc4EOuI4ciUO4GXIFW/GfpyT4e/WSvXjqjEw2Ei2UMK1vTIBh
         yZ2XlqixWwxP8XN+oyh0KZ+I7x2jFyB+2JJU+vXLkpDYKI9FJjUYwszRp/S1dA0k+yH4
         u5NtQ8ONn1Qo01KSjTc1VI/UaJ6TQzUJt0WJIkB2Smoo/tYujt/z2UymH/7b6p4bWnR5
         6vnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:date:in-reply-to:comments
         :references:to:subject:mime-version:content-type;
        bh=JG1rddQhATWaS/RNKWnHklASRONK/RyVBEzJH+As9UE=;
        b=LGWprm0lAtEimtX3cm7briCM50NqqwpwryD/cY7/+qdsp2Xe0TCS3rhx+VvrCL1c+y
         Go8jkqPOsKbGrziETjpEKjTbM2E8xmoFY4o5SekstSheBgcZevNMba3ohM3uhQUPGP2n
         Bqx8QMfy8vljp5T3tOvRnchoZM5Zc3yhqvo2oz4vsSyiltdeBH1pYvIS8Q6w3x70r96X
         LMjnIIniDUSxUHtr9+edyZJcxYlCbXWQQEy+yno8NepsvFsOFJwWT9MYYd7O47aRg8A2
         cnqRFPfmW9YkWaLUbFjJpuJmOoOC3TOGSyvMguixvVXlL6z1ELuUWywGcST1kiO9LD1r
         E4EA==
X-Gm-Message-State: AG10YOTyFwrJtTwrbQfuT4cayu0HCR5pShxEo723lEvSEhpshPADJpHupGBtRmyLaxSkkw==
X-Received: by 10.98.72.193 with SMTP id q62mr19060894pfi.117.1455486751327;
        Sun, 14 Feb 2016 13:52:31 -0800 (PST)
From: Bart Schaefer <schaefer@brasslantern.com>
Message-Id: <160214135247.ZM3326@torch.brasslantern.com>
Date: Sun, 14 Feb 2016 13:52:47 -0800
In-Reply-To: <20160205222750.1fda3574@ntlworld.com>
Comments: In reply to Peter Stephenson <p.w.stephenson@ntlworld.com>
        "Re: PATCH: funcstack[-1]  (formerly Suppress tracing of "set +x")" (Feb  5, 10:27pm)
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>
X-Mailer: OpenZMail Classic (0.9.2 24April2005)
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Assigning to $0 (formerly: PATCH: funcstack[-1])
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Seq: zsh-workers 37973

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.

