-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecated symbol(x...) becomes Symbol(x...) #15995
Changes from all commits
d346dbe
a0c71c9
e268b6a
330fb30
e9e2cc9
8e285da
5c2085a
9b0a2d1
89b233f
007fe4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ for period in (:Year, :Month, :Week, :Day, :Hour, :Minute, :Second, :Millisecond | |
|
||
The $($accessor_str) part of a $($description) as a `$($period_str)`.$($reference) | ||
""" -> | ||
$period(dt::$(symbol(typ_str))) = $period($(symbol(accessor_str))(dt)) | ||
$period(dt::$(Symbol(typ_str))) = $period($(Symbol(accessor_str))(dt)) | ||
|
||
@doc """ | ||
$($period_str)(v) | ||
|
@@ -87,7 +87,7 @@ for (op,Ty,Tz) in ((:.*,Real,:P), | |
(:div,:P,Int64), (:div,Integer,:P), | ||
(:mod,:P,Int64), (:mod,Integer,:P)) | ||
sop = string(op) | ||
op_ = sop[1] == '.' ? symbol(sop[2:end]) : op | ||
op_ = sop[1] == '.' ? Symbol(sop[2:end]) : op | ||
@eval begin | ||
function ($op){P<:Period}(X::StridedArray{P},y::$Ty) | ||
Z = similar(X, $Tz) | ||
|
@@ -229,7 +229,7 @@ GeneralPeriod = Union{Period,CompoundPeriod} | |
(+){P<:GeneralPeriod}(x::StridedArray{P}) = x | ||
|
||
for op in (:.+, :.-) | ||
op_ = symbol(string(op)[2:end]) | ||
op_ = Symbol(string(op)[2:end]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably clearer to use |
||
@eval begin | ||
function ($op){P<:GeneralPeriod}(X::StridedArray{P},y::GeneralPeriod) | ||
Z = similar(X, CompoundPeriod) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ complexfloat{T<:Real}(x::AbstractArray{T}) = copy!(Array(typeof(complex(float(on | |
# implementations only need to provide plan_X(x, region) | ||
# for X in (:fft, :bfft, ...): | ||
for f in (:fft, :bfft, :ifft, :fft!, :bfft!, :ifft!, :rfft) | ||
pf = symbol(string("plan_", f)) | ||
pf = Symbol(string("plan_", f)) | ||
@eval begin | ||
$f(x::AbstractArray) = $pf(x) * x | ||
$f(x::AbstractArray, region) = $pf(x, region) * x | ||
|
@@ -179,7 +179,7 @@ bfft! | |
# promote to a complex floating-point type (out-of-place only), | ||
# so implementations only need Complex{Float} methods | ||
for f in (:fft, :bfft, :ifft) | ||
pf = symbol(string("plan_", f)) | ||
pf = Symbol(string("plan_", f)) | ||
@eval begin | ||
$f{T<:Real}(x::AbstractArray{T}, region=1:ndims(x)) = $f(complexfloat(x), region) | ||
$pf{T<:Real}(x::AbstractArray{T}, region; kws...) = $pf(complexfloat(x), region; kws...) | ||
|
@@ -264,7 +264,7 @@ A_mul_B!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) = | |
# or odd). | ||
|
||
for f in (:brfft, :irfft) | ||
pf = symbol(string("plan_", f)) | ||
pf = Symbol(string("plan_", f)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that usages like this should probably be replaced with |
||
@eval begin | ||
$f(x::AbstractArray, d::Integer) = $pf(x, d) * x | ||
$f(x::AbstractArray, d::Integer, region) = $pf(x, d, region) * x | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,12 @@ | |
|
||
## symbols ## | ||
|
||
symbol(s::Symbol) = s | ||
symbol(s::ASCIIString) = symbol(s.data) | ||
symbol(s::UTF8String) = symbol(s.data) | ||
symbol(a::Array{UInt8,1}) = | ||
Symbol(s::Symbol) = s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OTOH this constructor is probably useless due to the fallback to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this what's causing the method error(s) @tkelman noticed? ...but like I say removing the convert kills the build. :/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As @nalimilan said, the default constructor calls |
||
Symbol(s::ASCIIString) = Symbol(s.data) | ||
Symbol(s::UTF8String) = Symbol(s.data) | ||
Symbol(a::Array{UInt8,1}) = | ||
ccall(:jl_symbol_n, Ref{Symbol}, (Ptr{UInt8}, Int32), a, length(a)) | ||
symbol(x...) = symbol(string(x...)) | ||
Symbol(x...) = Symbol(string(x...)) | ||
|
||
gensym() = ccall(:jl_gensym, Ref{Symbol}, ()) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ function plan_inv{T,K,inplace}(p::DCTPlan{T,K,inplace}) | |
end | ||
|
||
for f in (:dct, :dct!, :idct, :idct!) | ||
pf = symbol(string("plan_", f)) | ||
pf = Symbol(string("plan_", f)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need to call |
||
@eval begin | ||
$f{T<:fftwNumber}(x::AbstractArray{T}) = $pf(x) * x | ||
$f{T<:fftwNumber}(x::AbstractArray{T}, region) = $pf(x, region) * x | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,10 @@ function uv_sizeof_req(req) | |
end | ||
|
||
for h in uv_handle_types | ||
@eval const $(symbol("_sizeof_"*lowercase(string(h)))) = uv_sizeof_handle($h) | ||
@eval const $(Symbol("_sizeof_"*lowercase(string(h)))) = uv_sizeof_handle($h) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace |
||
end | ||
for r in uv_req_types | ||
@eval const $(symbol("_sizeof_"*lowercase(string(r)))) = uv_sizeof_req($r) | ||
@eval const $(Symbol("_sizeof_"*lowercase(string(r)))) = uv_sizeof_req($r) | ||
end | ||
|
||
uv_handle_data(handle) = ccall(:jl_uv_handle_data,Ptr{Void},(Ptr{Void},),handle) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be
Symbol("A_", i)