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 03:50 AM, Eric Cook wrote:

> I would expect it behave like:
> 
> % for i in "${empty[@]}"; do typeset -p i; done
> 
> Which won't iterate.
> 
i forgot the empty=(), which still results in not
expanding a word that isn't in the array.

python's zip function doesn't iterate:
python -c 'for v in zip([],[]): print("loop")'
nor ruby.
ruby -e '[].zip([]).each { puts "loop" }'
or perl
perl -MList::Gen=zip -E 'say "loop" for zip [], [];'



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