我是朱莉娅的新手,我无法找到where对我来说完全有意义的解释。所以我明白,例如 function f(x::T, y::T) where {T<:Number} = true要求 x 和 y 参数都是某种数字类型。
where
function f(x::T, y::T) where {T<:Number} = true
但是还有其他函数看起来像function f(X::AbstractMatrix{T}) where T没有任何关于 T 应该是什么的规范。有人可以解释一下它在做什么以及我什么时候想使用这种语法吗?
function f(X::AbstractMatrix{T}) where T
julia
julia ×1