From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22486 invoked by alias); 2 Oct 2014 16:06:38 -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: 33332 Received: (qmail 22481 invoked from network); 2 Oct 2014 16:06:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f156d0000063c7-80-542d78083963 Date: Thu, 02 Oct 2014 17:06:31 +0100 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: PATCH: safe numeric import Message-id: <20141002170631.155a88a1@pwslap01u.europe.root.pri> In-reply-to: <20140929110420.52cc66f8@pwslap01u.europe.root.pri> References: <20140925141133.49a7127b@pwslap01u.europe.root.pri> <22772.1411740194@thecus.kiddle.eu> <20140926210818.3ac1bf20@pws-pc.ntlworld.com> <20140929110420.52cc66f8@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmluLIzCtJLcpLzFFi42I5/e/4FV2OCt0Qg0UPpSwONj9kcmD0WHXw A1MAYxSXTUpqTmZZapG+XQJXxqO+QywFl1krPjcVNTBeZOli5OSQEDCRaF/zhBnCFpO4cG89 WxcjF4eQwFJGiUsdE1ggnOVMEt/3/AJyODhYBFQlnvYogjSwCRhKTN00mxEkLCKgLdH+UQwk LCygLrF7wgewmbwC9hLPplwH28Up4CCxb+l0RoiRU5gkFv38wQSS4BfQl7j69xMTxBH2EjOv nGGEaBaU+DH5Hlgzs4CWxOZtTawQtrzE5jVvmScwCsxCUjYLSdksJGULGJlXMYqmliYXFCel 5xrqFSfmFpfmpesl5+duYoQE4JcdjIuPWR1iFOBgVOLhzWjQCRFiTSwrrsw9xCjBwawkwqsX pRsixJuSWFmVWpQfX1Sak1p8iJGJg1OqgdGnas2XrWcPll9rKn662ubuk3eWH0ycqnUKHt26 larCc6ad+3reecftp89u8Z7Qt4Z36SLe9u8vevYUHeCdaFk5gfXrzGw+4Ugxx5sJesKtPH1V iU+rVliJ9she2hDYKl6/6MvulR0BSzly+NSnP5V691iTR/2aOTNvSfBm54VJL/bzzrJX36PE UpyRaKjFXFScCABpw1i/HgIAAA== On Mon, 29 Sep 2014 11:04:20 +0100 Peter Stephenson wrote: > OK, how about this? When we're doing the import, all numbers, integer > or floating point, are imported straight, without an evaluation. Here's a test --- I confirmed this does wayward things with old versions of the shell. diff --git a/Test/C01arith.ztst b/Test/C01arith.ztst index 25cd8b8..4c55b96 100644 --- a/Test/C01arith.ztst +++ b/Test/C01arith.ztst @@ -282,3 +282,7 @@ print $(( [#_] (5. ** 10) / 16. )) 0:Grouping output with underscores: floating point >610_351.562_5 + + env SHLVL=1+RANDOM $ZTST_testdir/../Src/zsh -f -c 'print $SHLVL' +0:Imported integer functions are not evaluated +>2 pws