From 4c23587bffc82c29690dfae05db1c71432431868 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Thu, 31 May 2018 10:33:28 +0200 Subject: [PATCH] Use `something` instead of `coalesce` --- src/base.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/base.jl b/src/base.jl index 0d73a4c3c..c33a1468d 100644 --- a/src/base.jl +++ b/src/base.jl @@ -1,5 +1,9 @@ # This file contains code formerly part of Julia. License is MIT: https://julialang.org/license +if !isdefined(Base, :something) + const something = Base.coalesce +end + # deprecations from base/deprecated.jl @deprecate varm(A::AbstractArray, m::AbstractArray, dims; kwargs...) varm(A, m; kwargs..., dims=dims) @deprecate var(A::AbstractArray, dims; kwargs...) var(A; kwargs..., dims=dims) @@ -164,10 +168,10 @@ The mean `mean` over the region may be provided. var(A::AbstractArray; corrected::Bool=true, mean=nothing, dims=:) = _var(A, corrected, mean, dims) _var(A::AbstractArray, corrected::Bool, mean, dims) = - varm(A, coalesce(mean, Base.mean(A, dims=dims)); corrected=corrected, dims=dims) + varm(A, something(mean, Base.mean(A, dims=dims)); corrected=corrected, dims=dims) _var(A::AbstractArray, corrected::Bool, mean, ::Colon) = - real(varm(A, coalesce(mean, Base.mean(A)); corrected=corrected)) + real(varm(A, something(mean, Base.mean(A)); corrected=corrected)) varm(iterable, m; corrected::Bool=true) = _var(iterable, corrected, m)