Skip to content

map with different length iterators #13361

@boathit

Description

@boathit

Is it reasonable that map can deal with infinite length iterators well but fails to work with two different finite length iterators?

map(+, [1,2,3], repeated(5))

3-element Array{Any,1}:
 6
 7
 8


map(+, [1,2,3], repeated(5, 10))

3-element Array{Any,1}:
 6
 7
 8


map(+, 1:3, repeated(5, 10))

3-element Array{Any,1}:
 6
 7
 8


works well

 map(+, [1,2,3], 1:10)

ERROR: DimensionMismatch("dimensions must match")
 in map at abstractarray.jl:1310

map(+, 1:3, 1:10)

ERROR: DimensionMismatch("dimensions must match")
 in map at abstractarray.jl:1310


error occurs

Metadata

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestGood for Hacktoberfest participantsgood first issueIndicates a good issue for first-time contributors to Julia

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions