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

Re: PATCH: 4.1: multi-parameter for loop



On Wed, 20 Jun 2001, Peter Stephenson wrote:

>
> This extends the for syntax to take multiple parameters after it; they take
> multiple words from the argument list.  The main intended use of this is
> for imitating perl's `each' feature:
>
>   typeset -A assoc
>   assoc=(key1 val1 key2 val2)
>   for key value in ${(kv)assoc}; do
>     print $key $value
>   done
>

This for sure is incompatible with POSIX and all known shells. It does
not make legal scripts fail, but it makes illegal scripts legal. Should we
care about it?

-andrej



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