zsh-workers
 help / color / mirror / code / Atom feed
* Math assignment to arrays:  Is this a bug?
@ 2006-09-03 17:28 Bart Schaefer
  2006-09-11 10:59 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2006-09-03 17:28 UTC (permalink / raw)
  To: zsh-workers

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?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-11 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-03 17:28 Math assignment to arrays: Is this a bug? Bart Schaefer
2006-09-11 10:59 ` Peter Stephenson

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).