From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 572 invoked by alias); 2 Jan 2016 19:37:36 -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: 37491 Received: (qmail 2895 invoked from network); 2 Jan 2016 19:37:35 -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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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=2MjjkhYIlDV32LQhKyVAhfdB0qyhenBLCQF5JFvv4tI=; b=0BU0NWor1QHe1eOZaS4rYhBJD2Tx2haydY47braYNnfanN5LvtAogn/5DT8Cjl/jOt ZKMRnDTE9Msi8TsQBsie0wC6Ydqj+ZcyF3JYYBlMVffA1WvNOkBXLi4fIjPmh6mr4JCi XCGEEpBg39ro4LXY4BitbekbC52H+DuCHzOYHNNuaB571sf3jhPjkIugmO7vp7C18BAu 0xHwEzU7xQNy18nS/vXtuGawkvec6fw95fJlpfHKdYItyFJtUsDQ51vdF329wc5PtjjO YEiidf/52nnnMCRskB3rY5uzAuTuBAlWqXO6DcXmc93XxrXkfP6tiQbmecvc1OWxqKaL +v5g== MIME-Version: 1.0 X-Received: by 10.55.27.93 with SMTP id b90mr66204625qkb.51.1451763452476; Sat, 02 Jan 2016 11:37:32 -0800 (PST) In-Reply-To: <20160102181126.364cc450@ntlworld.com> References: <5686DB95.2090602@inlv.org> <20160102181126.364cc450@ntlworld.com> Date: Sat, 2 Jan 2016 20:37:32 +0100 Message-ID: Subject: Re: [BUG] emulate sh: arith assignment assigns variable type From: Mikael Magnusson To: Peter Stephenson Cc: Martijn Dekker , zsh workers Content-Type: text/plain; charset=UTF-8 On Sat, Jan 2, 2016 at 7:11 PM, Peter Stephenson wrote: > On Fri, 01 Jan 2016 21:03:33 +0100 > Martijn Dekker wrote: >> When an assignment is done to an unset variable using an arithmetic >> expression, zsh assigns a numerical or arithmetic type to that variable, >> causing subsequent normal shell assignments to be interpreted as >> arithmetic expressions. > > Yes, it does. > > Does this need a special option? The linkage is a bit tenouous. > > diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo > index f377539..b5e9100 100644 > --- a/Doc/Zsh/options.yo > +++ b/Doc/Zsh/options.yo > @@ -2098,6 +2098,12 @@ When it is unset, zsh allows expressions of the form tt($#)var(name) > to refer to the length of tt($)var(name), even for special variables, > for example in expressions such as tt($#-) and tt($#*). > > +Another difference is that with the option set assignment to an > +unset variable in artihmetic context causes the variable to be created Typo here on artihmetic. I would also put a comma after 'with the option set'? -- Mikael Magnusson