Subject: Re: [BUG] emulate sh: arith assignment assigns variable type
From: Mikael Magnusson <[email-masked]>
To: Peter Stephenson <[email-masked]>
Cc: Martijn Dekker <[email-masked]>, zsh workers <[email-masked]>
Date: Sat, 2 Jan 2016 20:37:32 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Sat, Jan 2, 2016 at 7:11 PM, Peter Stephenson
<[email-masked]> wrote:
> On Fri, 01 Jan 2016 21:03:33 +0100
> Martijn Dekker <[email-masked]> 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