Skip to content

Commit 738066c

Browse files
authored
macro deprecate: docs tweak (#44178)
1 parent 88edb11 commit 738066c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

base/deprecated.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
# is only printed the first time for each call place.
1616

1717
"""
18-
@deprecate old new [ex=true]
18+
@deprecate old new [export_old=true]
1919
2020
Deprecate method `old` and specify the replacement call `new`. Prevent `@deprecate` from
21-
exporting `old` by setting `ex` to `false`. `@deprecate` defines a new method with the same
21+
exporting `old` by setting `export_old` to `false`. `@deprecate` defines a new method with the same
2222
signature as `old`.
2323
2424
!!! compat "Julia 1.5"
@@ -35,13 +35,13 @@ julia> @deprecate old(x) new(x) false
3535
old (generic function with 1 method)
3636
```
3737
"""
38-
macro deprecate(old, new, ex=true)
38+
macro deprecate(old, new, export_old=true)
3939
meta = Expr(:meta, :noinline)
4040
if isa(old, Symbol)
4141
oldname = Expr(:quote, old)
4242
newname = Expr(:quote, new)
4343
Expr(:toplevel,
44-
ex ? Expr(:export, esc(old)) : nothing,
44+
export_old ? Expr(:export, esc(old)) : nothing,
4545
:(function $(esc(old))(args...)
4646
$meta
4747
depwarn($"`$old` is deprecated, use `$new` instead.", Core.Typeof($(esc(old))).name.mt.name)
@@ -65,7 +65,7 @@ macro deprecate(old, new, ex=true)
6565
error("invalid usage of @deprecate")
6666
end
6767
Expr(:toplevel,
68-
ex ? Expr(:export, esc(oldsym)) : nothing,
68+
export_old ? Expr(:export, esc(oldsym)) : nothing,
6969
:($(esc(old)) = begin
7070
$meta
7171
depwarn($"`$oldcall` is deprecated, use `$newcall` instead.", Core.Typeof($(esc(oldsym))).name.mt.name)

0 commit comments

Comments
 (0)