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

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



On 01/01/2017 12:18 AM, Kannan Varadhan wrote:
> Isn't this identical to
> 
> % for i in "" ; do typeset -p i ; done
> 
> which yields exactly one iteration, as I would expect?
> 

That is indeed how it currently is, which is weird in my opinion.
Because when you expand an empty array in any other instance,
you don't get an argument/word; because there is none.

I would expect it behave like:

% for i in "${empty[@]}"; do typeset -p i; done

Which won't iterate.



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