zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Dan Nelson <dnelson@emsphone.com>
Cc: zsh-workers@sunsite.auc.dk
Subject: Re: 3.0.8 math bug?
Date: Thu, 17 Aug 2000 13:53:42 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.20.0008171238220.21745-100000@aztec.zanshin.com> (raw)
In-Reply-To: <20000817125441.A20946@dan.emsphone.com>

On Thu, 17 Aug 2000, Dan Nelson wrote:

> Why does evaluating a non-numeric variable cause 3.0.8 to consume all
> available RAM and then exit to the parent shell?

The operational answer is "because all previous versions of zsh do that,
and it hasn't been fixed yet in 3.0.8."

The semantic answer is "because the value of a variable evaluated in math
context is treated as an expression, and that expression is itself
evaluated."

E.g.

b=7
a=b
(( a )) --> b --> 7

a="3 + 4"
(( a )) --> 3 + 4 --> 7

a=a
(( a )) --> a --> a --> a --> ...

Hence in 3.1.somethingmorethan6butIforgetwhat, an arbitrary limit on the
depth of math recursion was imposed, and you get:

> zsh: math recursion limit exceeded

This does mean that there are expressions you can evaluate in 3.0.8 that
will eventually resolve to a value, which you can't evaluate in 3.1.9.  
They're a lot more complicated than anything you'd be likely to write out
by hand, though.


  reply	other threads:[~2000-08-17 20:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-17 17:54 Dan Nelson
2000-08-17 20:53 ` Bart Schaefer [this message]
2000-08-18  7:00 Sven Wischnowsky
2000-08-18  8:56 ` Peter Stephenson

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=Pine.LNX.4.20.0008171238220.21745-100000@aztec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=dnelson@emsphone.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).