From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Math assignment to arrays: Is this a bug?
Date: Sun, 03 Sep 2006 10:28:01 -0700 [thread overview]
Message-ID: <060903102801.ZM7627@torch.brasslantern.com> (raw)
Try this but be prepared to interrupt it:
x=()
for (( x=1; x <= 10; x++ )) print $x
An infinite stream of "1" is the output.
Put "unset x" between the two lines of the example and it works fine.
Change the example to
x=()
for (( x=1; x <= 10; x++ )) typeset x
and you get an infinite stream of "x=(1)".
Why doesn't the assignment of 1 to x in the loop reset it from array to
scalar?
next reply other threads:[~2006-09-03 17:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-03 17:28 Bart Schaefer [this message]
2006-09-11 10:59 ` 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=060903102801.ZM7627@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.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).