Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Weird error message when using bash or ksh form of array initialization



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.



Messages sorted by: Reverse Date, Date, Thread, Author