From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1749 invoked by alias); 2 Jan 2016 21:17:51 -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: 37495 Received: (qmail 17078 invoked from network); 2 Jan 2016 21:17:50 -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 autolearn=ham autolearn_force=no version=3.4.0 X-Originating-IP: [82.20.18.64] X-Spam: 0 X-Authority: v=2.1 cv=P+nH/X0u c=1 sm=1 tr=0 a=tQ56d2wE10i0ATcm3CvKvA==:117 a=tQ56d2wE10i0ATcm3CvKvA==:17 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=gQUQ_iEwyMt5Zi0rc0wA:9 a=CjuIK1q_8ugA:10 Date: Sat, 2 Jan 2016 21:12:18 +0000 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: [BUG] emulate sh: arith assignment assigns variable type Message-ID: <20160102211218.7601462d@ntlworld.com> In-Reply-To: <160102124659.ZM16393@torch.brasslantern.com> References: <5686DB95.2090602@inlv.org> <20160102181126.364cc450@ntlworld.com> <160102124659.ZM16393@torch.brasslantern.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 2 Jan 2016 12:46:59 -0800 Bart Schaefer wrote: > On the other hand, is this -- > > } pm = createparam(t, ss ? PM_ARRAY : > } + isset(POSIXIDENTIFIERS) ? PM_SCALAR : > } (val.type & MN_INTEGER) ? PM_INTEGER : PM_FFLOAT); > > -- really the correct fix? I was thinking more along the lines of > creating it as an integer but then changing the type back to scalar > at the time of assignment if the assigned string did not parse as an > arithmetic expression. That's obviously not what other POSIX shells do, so I don't see how that can be right. It's forcing arithmetic evaaluation in cases those shells wouldn't. The POSIX* options aren't supposed to be for anything more than strict(ish) compatibility. pws