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.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: <CAHYJk3RP1jnt81Rb3Qjzz9LGc9ffwa_68GJXJzvEVXePiwMzGg@mail.gmail.com>
Subject: Re: [BUG] emulate sh: arith assignment assigns variable type
From: Mikael Magnusson <mikachu@gmail.com>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>
Cc: Martijn Dekker <martijn@inlv.org>, zsh workers <zsh-workers@zsh.org>
Content-Type: text/plain; charset=UTF-8
X-Seq: zsh-workers 37491

On Sat, Jan 2, 2016 at 7:11 PM, Peter Stephenson
<p.w.stephenson@ntlworld.com> wrote:
> On Fri, 01 Jan 2016 21:03:33 +0100
> Martijn Dekker <martijn@inlv.org> 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

