Skip to content

Commit df832b7

Browse files
committed
Clean up Symbol usage (after symbol deprecation).
From comments by stevengj in #15995.
1 parent 6f15d92 commit df832b7

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

base/broadcast.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function gen_broadcast_body_iter_tobitarray(nd::Int, narrays::Int, f)
167167
end
168168

169169
function gen_broadcast_function(genbody::Function, nd::Int, narrays::Int, f)
170-
As = [Symbol("A_"*string(i)) for i = 1:narrays]
170+
As = [Symbol("A_",string(i)) for i = 1:narrays]
171171
body = genbody(nd, narrays, f)
172172
@eval let
173173
local _F_
@@ -179,7 +179,7 @@ function gen_broadcast_function(genbody::Function, nd::Int, narrays::Int, f)
179179
end
180180

181181
function gen_broadcast_function_tobitarray(genbody::Function, nd::Int, narrays::Int, f)
182-
As = [Symbol("A_"*string(i)) for i = 1:narrays]
182+
As = [Symbol("A_",string(i)) for i = 1:narrays]
183183
body = genbody(nd, narrays, f)
184184
@eval let
185185
local _F_

base/dates/arithmetic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ end
6767
(-)(y::Period,x::TimeType) = x - y
6868

6969
for op in (:.+, :.-)
70-
op_ = Symbol(string(op)[2:end])
70+
op_ = Symbol(string(op)[2])
7171
@eval begin
7272
# GeneralPeriod, AbstractArray{TimeType}
7373
($op){T<:TimeType}(x::AbstractArray{T}, y::GeneralPeriod) =

base/dates/periods.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ for (op,Ty,Tz) in ((:.*,Real,:P),
9595
(:.%,:P,:P),
9696
(:mod,:P,:P))
9797
sop = string(op)
98-
op_ = sop[1] == '.' ? Symbol(sop[2:end]) : op
98+
op_ = sop[1] == '.' ? Symbol(sop[2]) : op
9999
@eval begin
100100
function ($op){P<:Period}(X::StridedArray{P},y::$Ty)
101101
Z = similar(X, $Tz)
@@ -234,7 +234,7 @@ GeneralPeriod = Union{Period,CompoundPeriod}
234234
(+){P<:GeneralPeriod}(x::StridedArray{P}) = x
235235

236236
for op in (:.+, :.-)
237-
op_ = Symbol(string(op)[2:end])
237+
op_ = Symbol(string(op)[2])
238238
@eval begin
239239
function ($op){P<:GeneralPeriod}(X::StridedArray{P},y::GeneralPeriod)
240240
Z = similar(X, CompoundPeriod)

base/dft.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ complexfloat{T<:Real}(x::AbstractArray{T}) = copy!(Array(typeof(complex(float(on
3131
# implementations only need to provide plan_X(x, region)
3232
# for X in (:fft, :bfft, ...):
3333
for f in (:fft, :bfft, :ifft, :fft!, :bfft!, :ifft!, :rfft)
34-
pf = Symbol(string("plan_", f))
34+
pf = Symbol("plan_", f)
3535
@eval begin
3636
$f(x::AbstractArray) = $pf(x) * x
3737
$f(x::AbstractArray, region) = $pf(x, region) * x
@@ -179,7 +179,7 @@ bfft!
179179
# promote to a complex floating-point type (out-of-place only),
180180
# so implementations only need Complex{Float} methods
181181
for f in (:fft, :bfft, :ifft)
182-
pf = Symbol(string("plan_", f))
182+
pf = Symbol("plan_", f)
183183
@eval begin
184184
$f{T<:Real}(x::AbstractArray{T}, region=1:ndims(x)) = $f(complexfloat(x), region)
185185
$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) =
264264
# or odd).
265265

266266
for f in (:brfft, :irfft)
267-
pf = Symbol(string("plan_", f))
267+
pf = Symbol("plan_", f)
268268
@eval begin
269269
$f(x::AbstractArray, d::Integer) = $pf(x, d) * x
270270
$f(x::AbstractArray, d::Integer, region) = $pf(x, d, region) * x

base/fft/dct.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function plan_inv{T,K,inplace}(p::DCTPlan{T,K,inplace})
8282
end
8383

8484
for f in (:dct, :dct!, :idct, :idct!)
85-
pf = Symbol(string("plan_", f))
85+
pf = Symbol("plan_", f)
8686
@eval begin
8787
$f{T<:fftwNumber}(x::AbstractArray{T}) = $pf(x) * x
8888
$f{T<:fftwNumber}(x::AbstractArray{T}, region) = $pf(x, region) * x

base/libuv.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ function uv_sizeof_req(req)
2020
end
2121

2222
for h in uv_handle_types
23-
@eval const $(Symbol("_sizeof_"*lowercase(string(h)))) = uv_sizeof_handle($h)
23+
@eval const $(Symbol("_sizeof_",lowercase(string(h)))) = uv_sizeof_handle($h)
2424
end
2525
for r in uv_req_types
26-
@eval const $(Symbol("_sizeof_"*lowercase(string(r)))) = uv_sizeof_req($r)
26+
@eval const $(Symbol("_sizeof_",lowercase(string(r)))) = uv_sizeof_req($r)
2727
end
2828

2929
uv_handle_data(handle) = ccall(:jl_uv_handle_data,Ptr{Void},(Ptr{Void},),handle)

base/multidimensional.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,14 +455,14 @@ end
455455
for T in indexes.parameters
456456
T <: CartesianIndex ? (M += length(T)) : (M += 1)
457457
end
458-
index_length_expr = index <: Colon ? Symbol(string("Istride_", N+1)) : :(length(index))
458+
index_length_expr = index <: Colon ? Symbol("Istride_", N+1) : :(length(index))
459459
quote
460460
Cartesian.@nexprs $N d->(I_d = indexes[d])
461461
dimlengths = Cartesian.@ncall $N index_lengths_dim V.parent length(V.indexes)-N+1 I
462462
Istride_1 = 1 # strides of the indexes to merge
463463
Cartesian.@nexprs $N d->(Istride_{d+1} = Istride_d*dimlengths[d])
464464
idx_len = $(index_length_expr)
465-
if idx_len < 0.1*$(Symbol(string("Istride_", N+1))) # this has not been carefully tuned
465+
if idx_len < 0.1*$(Symbol("Istride_", N+1)) # this has not been carefully tuned
466466
return merge_indexes_div(V, indexes, index, dimlengths)
467467
end
468468
Cartesian.@nexprs $N d->(counter_d = 1) # counter_0 is the linear index

base/sparse/sparsevector.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ end
15161516
for isunittri in (true, false), islowertri in (true, false)
15171517
unitstr = isunittri ? "Unit" : ""
15181518
halfstr = islowertri ? "Lower" : "Upper"
1519-
tritype = :(Base.LinAlg.$(Symbol(string(unitstr, halfstr, "Triangular"))))
1519+
tritype = :(Base.LinAlg.$(Symbol(unitstr, halfstr, "Triangular")))
15201520

15211521
# build out-of-place left-division operations
15221522
for (istrans, func, ipfunc) in (

base/stream.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ _fd(x::IOStream) = RawFD(fd(x))
955955
ccall(:jl_uv_handle,Ptr{Void},(Ptr{Void},),x.handle))
956956

957957
for (x,writable,unix_fd,c_symbol) in ((:STDIN,false,0,:jl_uv_stdin),(:STDOUT,true,1,:jl_uv_stdout),(:STDERR,true,2,:jl_uv_stderr))
958-
f = Symbol("redirect_"*lowercase(string(x)))
958+
f = Symbol("redirect_",lowercase(string(x)))
959959
_f = Symbol("_",f)
960960
@eval begin
961961
function ($_f)(stream)

base/threadcall.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ macro threadcall(f, rettype, argtypes, argvals...)
4444
body = wrapper.args[2].args
4545
args = Symbol[]
4646
for (i,T) in enumerate(argtypes)
47-
arg = Symbol("arg$i")
47+
arg = Symbol("arg", i)
4848
push!(body, :($arg = unsafe_load(convert(Ptr{$T}, p))))
4949
push!(body, :(p += sizeof($T)))
5050
push!(args, arg)

0 commit comments

Comments
 (0)