From 738066c25d722a8bce8452caf54420e1da22730e Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Tue, 15 Feb 2022 06:52:05 +0100 Subject: [PATCH] macro deprecate: docs tweak (#44178) --- base/deprecated.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/base/deprecated.jl b/base/deprecated.jl index 7be5df7a53025..6709023147283 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -15,10 +15,10 @@ # is only printed the first time for each call place. """ - @deprecate old new [ex=true] + @deprecate old new [export_old=true] Deprecate method `old` and specify the replacement call `new`. Prevent `@deprecate` from -exporting `old` by setting `ex` to `false`. `@deprecate` defines a new method with the same +exporting `old` by setting `export_old` to `false`. `@deprecate` defines a new method with the same signature as `old`. !!! compat "Julia 1.5" @@ -35,13 +35,13 @@ julia> @deprecate old(x) new(x) false old (generic function with 1 method) ``` """ -macro deprecate(old, new, ex=true) +macro deprecate(old, new, export_old=true) meta = Expr(:meta, :noinline) if isa(old, Symbol) oldname = Expr(:quote, old) newname = Expr(:quote, new) Expr(:toplevel, - ex ? Expr(:export, esc(old)) : nothing, + export_old ? Expr(:export, esc(old)) : nothing, :(function $(esc(old))(args...) $meta depwarn($"`$old` is deprecated, use `$new` instead.", Core.Typeof($(esc(old))).name.mt.name) @@ -65,7 +65,7 @@ macro deprecate(old, new, ex=true) error("invalid usage of @deprecate") end Expr(:toplevel, - ex ? Expr(:export, esc(oldsym)) : nothing, + export_old ? Expr(:export, esc(oldsym)) : nothing, :($(esc(old)) = begin $meta depwarn($"`$oldcall` is deprecated, use `$newcall` instead.", Core.Typeof($(esc(oldsym))).name.mt.name)