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
2020Deprecate 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
2222signature as `old`.
2323
2424!!! compat "Julia 1.5"
@@ -35,13 +35,13 @@ julia> @deprecate old(x) new(x) false
3535old (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