From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: two mysteries
Date: Fri, 06 Nov 2015 14:22:23 -0800 [thread overview]
Message-ID: <563D281F.1000304@eastlink.ca> (raw)
In-Reply-To: <151106104455.ZM22748@torch.brasslantern.com>
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'?
next prev parent reply other threads:[~2015-11-06 22:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 18:12 Ray Andrews
2015-11-04 20:35 ` Bart Schaefer
2015-11-05 0:38 ` Ray Andrews
2015-11-06 18:44 ` Bart Schaefer
2015-11-06 22:22 ` Ray Andrews [this message]
2015-11-07 9:55 ` Bart Schaefer
2015-11-07 15:19 ` Ray Andrews
2015-11-07 17:19 ` Bart Schaefer
2015-11-07 18:37 ` Ray Andrews
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=563D281F.1000304@eastlink.ca \
--to=rayandrews@eastlink.ca \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).