zsh-workers
 help / color / mirror / code / Atom feed
* Weird error message when using bash or ksh form of array initialization
@ 2008-08-24 16:05 Rocky Bernstein
  2008-08-24 16:13 ` Mikael Magnusson
  2008-08-24 20:32 ` Bart Schaefer
  0 siblings, 2 replies; 6+ messages in thread
From: Rocky Bernstein @ 2008-08-24 16:05 UTC (permalink / raw)
  To: Zsh hackers list

When I run this (erroneous?) program:

  typeset -a fd=()
  typeset -a sources
  typeset -i xx

I get a weird error message:

  typeset:3: maximum nested function level reached

Note that neither of these give an error:

  typeset -a fd=()
  typeset -a sources

or

  typeset -a fd
  typeset -a sources
  typeset -i xx

or

  typeset -a fd
  fd=()
  typeset -a sources
  typeset -i xx

Somehow fd= is treated as a function which is indicated out by adding
a request to print out fd=:

 typeset -a fd=()
 typeset -a sources
 typeset -i xx
 declare -f fd=

Which reports:
  typeset:3: maximum nested function level reached
  'fd=' () {
 	typeset -a sources
  }

Can someone explain what's going on?

Since both bash and ksh allow an array initialization via the form
used above, it increases the chance of getting this weird error
message.

Thanks.


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

end of thread, other threads:[~2008-08-25  1:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-24 16:05 Weird error message when using bash or ksh form of array initialization Rocky Bernstein
2008-08-24 16:13 ` Mikael Magnusson
2008-08-24 20:32 ` Bart Schaefer
2008-08-25  0:12   ` Rocky Bernstein
2008-08-25  0:40     ` Mikael Magnusson
2008-08-25  1:02       ` Rocky Bernstein

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