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

Re: Should zipping two empty arrays result in empty string?



On Dec 31, 10:49pm, Eric Cook wrote:
}
} The following code results in a single loop
} 
} a=() b=(); for n in "${(@)a:^b}"; do typeset -p n; done
} typeset n=''
} 
} My question is, would anyone expect that? or would the you expect
} nothing to expand, resulting in the loop not iterating?

The zip operation is stepping on the internal state that records the
semantics of (@)-inside-double-quotes, so it always behaves as if
you did "${a[*]:^b}" instead.  Patch to zsh-workers, assuming gmail
doesn't get blocked again.



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