From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19986 invoked by alias); 13 Jun 2015 23:58:35 -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: 35463 Received: (qmail 21735 invoked from network); 13 Jun 2015 23:58:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.0 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=DeZHO9sbDPD+apzij22EGVVu/1Rd5/BGc48+f3CiF1s=; b=cymQTAfBSvi/irpgoneIq3eR442zZqhUDm36O364vS5LSP2m5K4C0tnHfmql7PtI0e Wfr8d9c5RNmz3IM5LLTzD0ZBVWtx4E7CrJNrf+dkm5z4T11PjcK9nJWYKjrQbemHtcsl /ppGbI0gD0/GBUA9o8Es0m7wkYcANkdH+Xh1sMlrdGuM2HhM1tNO87rDsxVH0GakqcZL Tf7NhNwfQpOC5Q/bYUNv1uPY+ijMdHCzIbyG6yDBik6+54Ssd3HcC7hZ8qTRPFYDfRgk RflqGNZspgsAQd8pXzJntqdU+2nJeysxvHOxcX/cHL2ZNJz8/hP6r0d2shyxGofDRz7s WyyA== X-Gm-Message-State: ALoCoQmuqVe+/UfmLeyH3ahTK8nsW8rEHTTHnE+KgxsOhoIcydwz7jUWiaNUfq4RMAXlTSjMffp/ X-Received: by 10.60.141.42 with SMTP id rl10mr17760530oeb.25.1434239910477; Sat, 13 Jun 2015 16:58:30 -0700 (PDT) From: Bart Schaefer Message-Id: <150613165827.ZM29680@torch.brasslantern.com> Date: Sat, 13 Jun 2015 16:58:27 -0700 In-Reply-To: Comments: In reply to Mikael Magnusson "Can't overwrite $0 in functions anymore" (Jun 14, 1:05am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers , zsh workers Subject: Re: Can't overwrite $0 in functions anymore MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 14, 1:05am, Mikael Magnusson wrote: } } Is this an intended change? Hm. Sort of. It's a side-effect of implementing POSIX_ARGZERO. With POSIX_ARGZERO set, $0 must always contain the name used to invoke the shell. If POSIX_ARGZERO changes from set to not set, $0 has to be restored as specified by the (on or off) setting of FUNCTION_ARGZERO. Consequently the value of $0 became fixed for both cases; assignments to it are no-ops. However, you can still change the value of $0 by hiding the special: torch% () { local -h 0=hello; echo $0 } hello