-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Description
julia> f() = 9
f (generic function with 1 method)
julia> map(f)
9map is a variadic zipWith, so I think it should behave like zip.
I don't see a justification for making it call f once. f should be called once when the shortest data argument has length 1. But in zip() the shortest data argument is assumed to have infinite length. So the most consistent behavior is to yield an infinite stream of empty tuples. That is the current behavior of zip().
Triage thinks that
zip()should either be an infinite stream, or it should error.
I would think then map(f) should either yield an infinite stream of f() or throw an error.
For comparison, in Python, which has variadic map, it needs at least 1 data argument and throws an error otherwise.
This problem was pointed out on Discourse.
Metadata
Metadata
Assignees
Labels
No labels