具有简单的功能,例如
function fun(x::Real, y::Real)
x, y
end
我想通过做使用 pmap() 调用
pmap(fun, [x for x=0:.1:2], [y for y=4:-.1:2])
朱莉娅给出了这个错误
ERROR: LoadError: MethodError: Cannot `convert` an object of type Tuple{Float64,Float64} to an object of type AbstractFloat
This may have arisen from a call to the constructor AbstractFloat(...),
since type constructors fall back to convert methods.
我真的不明白这里发生了什么。
根据我所做的一些研究:
It's well-established that to call map on an N-argument function, you pass N lists (or whatever collection) to map:
julia> map(+, (1,2), (3,4))
(4,6)
那怎么了?