@@ -249,7 +249,7 @@ for f in ( :acos_fast, :acosh_fast, :angle_fast, :asin_fast, :asinh_fast,
249
249
:cosh_fast , :exp10_fast , :exp2_fast , :exp_fast , :expm1_fast ,
250
250
:lgamma_fast , :log10_fast , :log1p_fast , :log2_fast , :log_fast ,
251
251
:sin_fast , :sinh_fast , :sqrt_fast , :tan_fast , :tanh_fast )
252
- eval ( FastMath, :( Base. @dep_vectorize_1arg Number $ f))
252
+ @ eval FastMath Base. @dep_vectorize_1arg Number $ f
253
253
end
254
254
for f in (
255
255
:invdigamma , # base/special/gamma.jl
265
265
@dep_vectorize_1arg Complex float
266
266
# base/dates/*.jl
267
267
for f in (:unix2datetime , :rata2datetime , :julian2datetime ) # base/dates/conversions.jl
268
- eval ( Dates, :( Base. @dep_vectorize_1arg Real $ f))
268
+ @ eval Dates Base. @dep_vectorize_1arg Real $ f
269
269
end
270
270
for f in (
271
271
# base/dates/accessors.jl
@@ -279,15 +279,15 @@ for f in (
279
279
:daysofweekinmonth , :monthname , :monthabbr , :daysinmonth ,
280
280
:isleapyear , :dayofyear , :daysinyear , :quarterofyear , :dayofquarter ,
281
281
)
282
- eval ( Dates, :( Base. @dep_vectorize_1arg Dates. TimeType $ f))
282
+ @ eval Dates Base. @dep_vectorize_1arg Dates. TimeType $ f
283
283
end
284
284
for f in (
285
285
:hour , :minute , :second , :millisecond , # base/dates/accessors.jl
286
286
:Date , :datetime2unix , :datetime2rata , :datetime2julian , # base/dates/conversions.jl
287
287
)
288
- eval ( Dates, :( Base. @dep_vectorize_1arg Dates. DateTime $ f))
288
+ @ eval Dates Base. @dep_vectorize_1arg Dates. DateTime $ f
289
289
end
290
- eval ( Dates, :( Base. @dep_vectorize_1arg Dates. Date Datetime)) # base/dates/conversions.jl
290
+ @ eval Dates Base. @dep_vectorize_1arg Dates. Date Datetime # base/dates/conversions.jl
291
291
292
292
# Deprecate @vectorize_2arg-vectorized functions from...
293
293
for f in (
@@ -304,7 +304,7 @@ for f in (
304
304
end
305
305
# base/fastmath.jl
306
306
for f in (:pow_fast , :atan2_fast , :hypot_fast , :max_fast , :min_fast , :minmax_fast )
307
- eval ( FastMath, :( Base. @dep_vectorize_2arg Number $ f))
307
+ @ eval FastMath Base. @dep_vectorize_2arg Number $ f
308
308
end
309
309
for f in (
310
310
:max , :min , # base/math.jl
@@ -356,14 +356,14 @@ end
356
356
@deprecate abs (x:: AbstractSparseVector ) abs .(x)
357
357
358
358
# Deprecate @textmime into the Multimedia module, #18441
359
- eval ( Multimedia, :( macro textmime (mime)
359
+ @ eval Multimedia macro textmime (mime)
360
360
Base. depwarn (string (" `@textmime \" mime\" ` is deprecated; use " ,
361
361
" `Base.Multimedia.istextmime(::MIME\" mime\" ) = true` instead"
362
362
), :textmime )
363
363
quote
364
364
Base. Multimedia. istextmime (:: MIME{$(Meta.quot(Symbol(mime)))} ) = true
365
365
end
366
- end ))
366
+ end
367
367
368
368
@deprecate ipermutedims (A:: AbstractArray ,p) permutedims (A, invperm (p))
369
369
@@ -440,7 +440,7 @@ function reduced_dims0(a::AbstractArray, region)
440
440
end
441
441
442
442
# #18218
443
- eval ( Base. LinAlg, quote
443
+ @ eval Base. LinAlg begin
444
444
function arithtype (T)
445
445
Base. depwarn (string (" arithtype is now deprecated. If you were using it inside a " ,
446
446
" promote_op call, use promote_op(LinAlg.matprod, Ts...) instead. Otherwise, " ,
@@ -455,7 +455,7 @@ eval(Base.LinAlg, quote
455
455
:arithtype )
456
456
Int
457
457
end
458
- end )
458
+ end
459
459
460
460
# #19246
461
461
@deprecate den denominator
@@ -468,7 +468,7 @@ Filesystem.stop_watching(stream::Filesystem._FDWatcher) = depwarn("stop_watching
468
468
@deprecate takebuf_string (b) String (take! (b))
469
469
470
470
# #19288
471
- eval ( Base. Dates, quote
471
+ @ eval Base. Dates begin
472
472
function recur {T<:TimeType} (fun:: Function , dr:: StepRange{T} ; negate:: Bool = false , limit:: Int = 10000 )
473
473
Base. depwarn (" Dates.recur is deprecated, use filter instead." ,:recur )
474
474
if negate
@@ -478,7 +478,7 @@ eval(Base.Dates, quote
478
478
end
479
479
end
480
480
recur {T<:TimeType} (fun:: Function , start:: T , stop:: T ; step:: Period = Day (1 ), negate:: Bool = false , limit:: Int = 10000 ) = recur (fun, start: step: stop; negate= negate)
481
- end )
481
+ end
482
482
483
483
# Index conversions revamp; #19730
484
484
function getindex (A:: LogicalIndex , i:: Int )
@@ -655,13 +655,15 @@ function _depwarn_bczpres!(f, args...)
655
655
depwarn (_depstring_bczpres (), :broadcast_zpreserving! )
656
656
return _broadcast_zpreserving! (f, args... )
657
657
end
658
- eval (SparseArrays, :(broadcast_zpreserving (f, args... ) = Base. _depwarn_bczpres (f, args... )))
659
- eval (SparseArrays, :(broadcast_zpreserving (f, A:: SparseMatrixCSC , B:: SparseMatrixCSC ) = Base. _depwarn_bczpres (f, A, B)))
660
- eval (SparseArrays, :(broadcast_zpreserving (f, A:: SparseMatrixCSC , B:: Union{Array,BitArray,Number} ) = Base. _depwarn_bczpres (f, A, B)))
661
- eval (SparseArrays, :(broadcast_zpreserving (f, A:: Union{Array,BitArray,Number} , B:: SparseMatrixCSC ) = Base. _depwarn_bczpres (f, A, B)))
662
- eval (SparseArrays, :(broadcast_zpreserving! (f, args... ) = Base. _depwarn_bczpres! (f, args... )))
663
- eval (SparseArrays, :(broadcast_zpreserving! (f, C:: SparseMatrixCSC , A:: SparseMatrixCSC , B:: Union{Array,BitArray,Number} ) = Base. _depwarn_bczpres! (f, C, A, B)))
664
- eval (SparseArrays, :(broadcast_zpreserving! (f, C:: SparseMatrixCSC , A:: Union{Array,BitArray,Number} , B:: SparseMatrixCSC ) = Base. _depwarn_bczpres! (f, C, A, B)))
658
+ @eval SparseArrays begin
659
+ broadcast_zpreserving (f, args... ) = Base. _depwarn_bczpres (f, args... )
660
+ broadcast_zpreserving (f, A:: SparseMatrixCSC , B:: SparseMatrixCSC ) = Base. _depwarn_bczpres (f, A, B)
661
+ broadcast_zpreserving (f, A:: SparseMatrixCSC , B:: Union{Array,BitArray,Number} ) = Base. _depwarn_bczpres (f, A, B)
662
+ broadcast_zpreserving (f, A:: Union{Array,BitArray,Number} , B:: SparseMatrixCSC ) = Base. _depwarn_bczpres (f, A, B)
663
+ broadcast_zpreserving! (f, args... ) = Base. _depwarn_bczpres! (f, args... )
664
+ broadcast_zpreserving! (f, C:: SparseMatrixCSC , A:: SparseMatrixCSC , B:: Union{Array,BitArray,Number} ) = Base. _depwarn_bczpres! (f, C, A, B)
665
+ broadcast_zpreserving! (f, C:: SparseMatrixCSC , A:: Union{Array,BitArray,Number} , B:: SparseMatrixCSC ) = Base. _depwarn_bczpres! (f, C, A, B)
666
+ end
665
667
666
668
# #19719
667
669
@deprecate getindex (t:: Tuple , r:: AbstractArray ) getindex (t, vec (r))
@@ -1030,7 +1032,7 @@ iteratoreltype(::Type{Task}) = EltypeUnknown()
1030
1032
1031
1033
isempty (:: Task ) = error (" isempty not defined for Tasks" )
1032
1034
1033
- eval ( Base. Test, quote
1035
+ @ eval Base. Test begin
1034
1036
approx_full (x:: AbstractArray ) = x
1035
1037
approx_full (x:: Number ) = x
1036
1038
approx_full (x) = full (x)
@@ -1095,7 +1097,7 @@ eval(Base.Test, quote
1095
1097
:(test_approx_eq ($ (esc (a)), $ (esc (b)), $ (string (a)), $ (string (b))))
1096
1098
end
1097
1099
export @test_approx_eq
1098
- end )
1100
+ end
1099
1101
1100
1102
# Deprecate partial linear indexing
1101
1103
function partial_linear_indexing_warning_lookup (nidxs_remaining)
@@ -1138,23 +1140,23 @@ function partial_linear_indexing_warning(n)
1138
1140
end
1139
1141
1140
1142
# Deprecate Array(T, dims...) in favor of proper type constructors
1141
- @deprecate Array {T,N} (:: Type{T} , d:: NTuple{N,Int} ) Array {T,N } (d)
1142
- @deprecate Array {T} (:: Type{T} , d:: Int... ) Array {T,length(d) } (d... )
1143
- @deprecate Array {T} (:: Type{T} , m:: Int ) Array {T,1 } (m)
1144
- @deprecate Array {T} (:: Type{T} , m:: Int ,n:: Int ) Array {T,2 } (m,n)
1145
- @deprecate Array {T} (:: Type{T} , m:: Int ,n:: Int ,o:: Int ) Array {T,3 } (m,n,o)
1146
- @deprecate Array {T} (:: Type{T} , d:: Integer... ) Array {T,length(d) } (convert (Tuple{Vararg{Int}}, d))
1147
- @deprecate Array {T} (:: Type{T} , m:: Integer ) Array {T,1 } (Int (m))
1148
- @deprecate Array {T} (:: Type{T} , m:: Integer ,n:: Integer ) Array {T,2 } (Int (m),Int (n))
1149
- @deprecate Array {T} (:: Type{T} , m:: Integer ,n:: Integer ,o:: Integer ) Array {T,3 } (Int (m),Int (n),Int (o))
1143
+ @deprecate Array {T,N} (:: Type{T} , d:: NTuple{N,Int} ) Array {T} (d)
1144
+ @deprecate Array {T} (:: Type{T} , d:: Int... ) Array {T} (d... )
1145
+ @deprecate Array {T} (:: Type{T} , m:: Int ) Array {T} (m)
1146
+ @deprecate Array {T} (:: Type{T} , m:: Int ,n:: Int ) Array {T} (m,n)
1147
+ @deprecate Array {T} (:: Type{T} , m:: Int ,n:: Int ,o:: Int ) Array {T} (m,n,o)
1148
+ @deprecate Array {T} (:: Type{T} , d:: Integer... ) Array {T} (convert (Tuple{Vararg{Int}}, d))
1149
+ @deprecate Array {T} (:: Type{T} , m:: Integer ) Array {T} (Int (m))
1150
+ @deprecate Array {T} (:: Type{T} , m:: Integer ,n:: Integer ) Array {T} (Int (m),Int (n))
1151
+ @deprecate Array {T} (:: Type{T} , m:: Integer ,n:: Integer ,o:: Integer ) Array {T} (Int (m),Int (n),Int (o))
1150
1152
1151
1153
# Likewise for SharedArrays
1152
- @deprecate SharedArray {T,N} (:: Type{T} , dims:: Dims{N} ; kwargs... ) SharedArray {T,N } (dims; kwargs... )
1153
- @deprecate SharedArray {T} (:: Type{T} , dims:: Int... ; kwargs... ) SharedArray {T,length(dims) } (dims... ; kwargs... )
1154
+ @deprecate SharedArray {T,N} (:: Type{T} , dims:: Dims{N} ; kwargs... ) SharedArray {T} (dims; kwargs... )
1155
+ @deprecate SharedArray {T} (:: Type{T} , dims:: Int... ; kwargs... ) SharedArray {T} (dims... ; kwargs... )
1154
1156
@deprecate (SharedArray {T,N} (filename:: AbstractString , :: Type{T} , dims:: NTuple{N,Int} , offset; kwargs... ),
1155
- SharedArray {T,N } (filename, dims, offset; kwargs... ))
1157
+ SharedArray {T} (filename, dims, offset; kwargs... ))
1156
1158
@deprecate (SharedArray {T} (filename:: AbstractString , :: Type{T} , dims:: NTuple , offset; kwargs... ),
1157
- SharedArray {T,length(dims) } (filename, dims, offset; kwargs... ))
1159
+ SharedArray {T} (filename, dims, offset; kwargs... ))
1158
1160
1159
1161
@noinline function is_intrinsic_expr (x:: ANY )
1160
1162
Base. depwarn (" is_intrinsic_expr is deprecated. There are no intrinsic functions anymore." , :is_intrinsic_expr )
@@ -1177,7 +1179,7 @@ function colon{T<:Dates.Period}(start::T, stop::T)
1177
1179
end
1178
1180
1179
1181
# LibGit2 refactor (#19839)
1180
- eval ( Base. LibGit2, quote
1182
+ @ eval Base. LibGit2 begin
1181
1183
Base. @deprecate_binding Oid GitHash
1182
1184
Base. @deprecate_binding GitAnyObject GitUnknownObject
1183
1185
@@ -1187,23 +1189,21 @@ eval(Base.LibGit2, quote
1187
1189
@deprecate revparse (repo:: GitRepo , objname:: AbstractString ) GitObject (repo, objname) false
1188
1190
@deprecate object (repo:: GitRepo , te:: GitTreeEntry ) GitObject (repo, te) false
1189
1191
@deprecate commit (ann:: GitAnnotated ) GitHash (ann) false
1190
- end )
1192
+ end
1191
1193
1192
1194
# when this deprecation is deleted, remove all calls to it, and all
1193
1195
# negate=nothing keyword arguments, from base/dates/adjusters.jl
1194
- eval (Dates, quote
1195
- function deprecate_negate (f, func, sig, negate)
1196
- if negate === nothing
1197
- return func
1198
- else
1199
- msg = " $f ($sig ; negate=$negate ) is deprecated, use $f ("
1200
- negate && (msg *= " !" )
1201
- msg *= " $sig ) instead."
1202
- Base. depwarn (msg, f)
1203
- return negate ? ! func : func
1204
- end
1196
+ @eval Dates function deprecate_negate (f, func, sig, negate)
1197
+ if negate === nothing
1198
+ return func
1199
+ else
1200
+ msg = " $f ($sig ; negate=$negate ) is deprecated, use $f ("
1201
+ negate && (msg *= " !" )
1202
+ msg *= " $sig ) instead."
1203
+ Base. depwarn (msg, f)
1204
+ return negate ? ! func : func
1205
1205
end
1206
- end )
1206
+ end
1207
1207
1208
1208
# FloatRange replaced by StepRangeLen
1209
1209
0 commit comments