From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4846 invoked by alias); 6 Nov 2015 22:22:31 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20902 Received: (qmail 11972 invoked from network); 6 Nov 2015 22:22:28 -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-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=NKvc7L9z7/b0bXwZ1ZmuGA==:117 a=NKvc7L9z7/b0bXwZ1ZmuGA==:17 a=N659UExz7-8A:10 a=Aj2vj58AHOK_S-Un_DcA:9 a=pILNOxqGKmIA:10 Message-id: <563D281F.1000304@eastlink.ca> Date: Fri, 06 Nov 2015 14:22:23 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: zsh-users@zsh.org Subject: Re: two mysteries References: <563A4A75.1020009@eastlink.ca> <151104123546.ZM20556@torch.brasslantern.com> <563AA51B.3040101@eastlink.ca> <151106104455.ZM22748@torch.brasslantern.com> In-reply-to: <151106104455.ZM22748@torch.brasslantern.com> Content-type: text/plain; charset=windows-1252; format=flowed Content-transfer-encoding: 7bit On 11/06/2015 10:44 AM, Bart Schaefer wrote: > On Nov 4, 4:38pm, Ray Andrews wrote: > } > } You're probably right. It's very hard to track. However there's no > } question that the type changes from integer when it happens, I've used > } the (t) flag to check. > > I suspect further that you're not examining the same variable after the > error as before. The divide-by-zero is a fatal error, e.g.: Yup, it always crashes. > > > Note that the "print" statement was never executed. If I bring it up > to top level: > > torch% integer x > torch% x=foo/bar > zsh: division by zero > torch% print ${(t)x} > integer > torch% > But what ended up happening is that the type check reported it as (can't recall) no longer integer, and I did the check just before the fatal division, so something had changed it previous to that. Anyway it hardly ever happens, and hasn't for quite some time so I can't do any more poking at it until it happens again. But the divisor in that case was 'page_hight' which is the terminal hight and (God willing) is never zero. But maybe there's a subterfuge there, with some de novo variable, as you suggest. Hard to keep an eye on these things. With several arrays sloshing around, some rogue value could pop up. But my experiments with Sebastian's stuff has been a real education. I've cut it to 2/3 the size while doubling speed and adding a few features and fixing a few bugs. But it's too big for zsh--one misses the rigorous control of variables. Speaking of integers, re: my ranting about the type changing. I had a general purpose 'tmp' variable, which I dutifully declared 'integer', and absent mindedly tried to use for a string. and zsh vigorously denounced the effort, which was much appreciated. So at least in that case it wasn't going to entertain any type change. Didn't I read that there's a difference between 'typeset -i' and 'integer'?