I find the following behavior of zip extremely confusing;
either I am misunderstanding something, or perhaps there
is a bug in the implementation of zip(?) [I would expect
the first and last expressions to give the same result!] :


julia> [t for t in zip([2,3,4],[6,7,8])]
3-element Array{(Int64,Int64),1}:
 (2,6)
 (3,7)
 (4,8)

julia> x = [2,3,4]
3-element Array{Int64,1}:
 2
 3
 4

julia> y = [6,7,8]
3-element Array{Int64,1}:
 6
 7
 8

julia> [t for t in zip(x,y)]
1-element Array{(Any,Any),1}:
(4,7)


Can anyone explain this behavior??

Thanks!

Cheers,
Ron Rivest 

 

Reply via email to