Skip to content

Commit

Permalink
String was renamed to AbstractString, replace everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Aug 20, 2015
1 parent 92ddae7 commit bffa22f
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion contrib/Julia_Notepad++.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<Keywords name="Folders in comment, middle"></Keywords>
<Keywords name="Folders in comment, close"></Keywords>
<Keywords name="Keywords1">true false C_NULL Inf NaN Inf32 NaN32 nothing</Keywords>
<Keywords name="Keywords2">ASCIIString AbstractArray AbstractMatrix AbstractSparseMatrix AbstractVector Any ArgumentError Array Associative AsyncStream BigFloat BigInt BitArray BitMatrix BitVector Bool BunchKaufman ByteString Cchar Cdouble Cfloat Char CharString CholeskyDense CholeskyPivotedDense Cint Cintmax_t Clong Clonglong Colon Complex Complex128 Complex64 ComplexPair Cptrdiff_t Cshort Csize_t Cuchar Cuint Cuintmax_t Culong Culonglong Cushort DArray Dict Dims DisconnectException EOFError EachLine EnvHash ErrorException Exception Expr Factorization FileOffset Filter Float Float32 Float64 Function GSVDDense IO IOBuffer IOStream ImaginaryUnit InsertionSort Int Int128 Int16 Int32 Int64 Int8 IntSet Integer KeyError LDLTTridiagonal LUDense LUTridiagonal LoadError LocalProcess Matrix MergeSort MethodError NTuple Number ObjectIdDict ObjectIdDict OrdinalRange ParseError PipeBuffer ProcessGroup Ptr QRDense QRPivotedDense QuickSort Range Range1 RangeIndex Ranges Rational Real Regex RegexMatch RegexMatchIterator RemoteRef RepString RevString Reverse RopeString SVDDense Set Signed SparseMatrixCSC SpawnNullStream Stat StridedArray StridedMatrix StridedVecOrMat StridedVector String SubArray SubDArray SubOrDArray SubString SymTridiagonal Symbol SystemError Task TcpSocket TimSort Tridiagonal Tuple Type TypeError UInt UInt128 UInt16 UInt32 UInt64 UInt8 UTF8String UVError Union Unsigned VecOrMat Vector VersionNumber Void WeakKeyDict WeakRef Zip</Keywords>
<Keywords name="Keywords2">ASCIIString AbstractArray AbstractMatrix AbstractSparseMatrix AbstractString AbstractVector Any ArgumentError Array Associative AsyncStream BigFloat BigInt BitArray BitMatrix BitVector Bool BunchKaufman ByteString Cchar Cdouble Cfloat Char CharString CholeskyDense CholeskyPivotedDense Cint Cintmax_t Clong Clonglong Colon Complex Complex128 Complex64 ComplexPair Cptrdiff_t Cshort Csize_t Cuchar Cuint Cuintmax_t Culong Culonglong Cushort DArray Dict Dims DisconnectException EOFError EachLine EnvHash ErrorException Exception Expr Factorization FileOffset Filter Float Float32 Float64 Function GSVDDense IO IOBuffer IOStream ImaginaryUnit InsertionSort Int Int128 Int16 Int32 Int64 Int8 IntSet Integer KeyError LDLTTridiagonal LUDense LUTridiagonal LoadError LocalProcess Matrix MergeSort MethodError NTuple Number ObjectIdDict ObjectIdDict OrdinalRange ParseError PipeBuffer ProcessGroup Ptr QRDense QRPivotedDense QuickSort Range Range1 RangeIndex Ranges Rational Real Regex RegexMatch RegexMatchIterator RemoteRef RepString RevString Reverse RopeString SVDDense Set Signed SparseMatrixCSC SpawnNullStream Stat StridedArray StridedMatrix StridedVecOrMat StridedVector SubArray SubDArray SubOrDArray SubString SymTridiagonal Symbol SystemError Task TcpSocket TimSort Tridiagonal Tuple Type TypeError UInt UInt128 UInt16 UInt32 UInt64 UInt8 UTF8String UVError Union Unsigned VecOrMat Vector VersionNumber Void WeakKeyDict WeakRef Zip</Keywords>
<Keywords name="Keywords3">abstract begin baremodule bitstype break catch ccall const continue do else elseif end export finally for function global if immutable import importall let local macro module quote return try type typealias using while</Keywords>
<Keywords name="Keywords4">close enumerate error info open print println read write warn</Keywords>
<Keywords name="Keywords5">print println</Keywords>
Expand Down
2 changes: 1 addition & 1 deletion contrib/julia-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ This function provides equivalent functionality, but makes no efforts to optimis
"Array" "DArray" "AbstractArray" "AbstractVector" "AbstractMatrix" "AbstractSparseMatrix" "SubArray" "StridedArray" "StridedVector" "StridedMatrix" "VecOrMat" "StridedVecOrMat" "DenseArray" "SparseMatrixCSC" "BitArray"
"Range" "OrdinalRange" "StepRange" "UnitRange" "FloatRange"
"Tuple" "NTuple" "Vararg"
"DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "String" "Ptr" "Void" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "ObjectIdDict"
"DataType" "Symbol" "Function" "Vector" "Matrix" "Union" "Type" "Any" "Complex" "AbstractString" "Ptr" "Void" "Exception" "Task" "Signed" "Unsigned" "Associative" "Dict" "IO" "IOStream" "Rational" "Regex" "RegexMatch" "Set" "IntSet" "Expr" "WeakRef" "ObjectIdDict"
"AbstractRNG" "MersenneTwister"
)
'symbols))
Expand Down
2 changes: 1 addition & 1 deletion contrib/julia.hrc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<!-- General types -->
<keywords region="mlStdFunc">
<word name="Array"/>
<word name="String"/>
<word name="AbstractString"/>
<word name="Bool"/>
<word name="Number"/>
<word name="Int"/>
Expand Down
2 changes: 1 addition & 1 deletion contrib/julia.lang
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
<keyword>SparseMatrixCSC</keyword>
<keyword>(D|Sub((Or)?D)?)Array</keyword>
<keyword>Chars?</keyword>
<keyword>(ASCII|Byte|Char|DirectIndex|Generic|Rep|Rev|Rope|Sub|UTF8)?String</keyword>
<keyword>(Abstract|ASCII|Byte|Char|DirectIndex|Generic|Rep|Rev|Rope|Sub|UTF8)String</keyword>
<keyword>Bool</keyword>
<keyword>Number</keyword>
<keyword>Real</keyword>
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/calling-c-and-fortran-code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ Syntax / Keyword Example Description
``bitstype`` ``Int``, "Bits Type" :: A type with no fields, but a size. It
``Float64`` is stored and defined by-value.

``immutable`` ``Pair{String,String}`` "Immutable" :: A type with all fields defined to be
``immutable`` ``Pair{Int,Int}`` "Immutable" :: A type with all fields defined to be
constant. It is defined by-value. And may be stored
with a type-tag.

Expand Down
2 changes: 1 addition & 1 deletion doc/manual/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ example:
end
"When applied to strings, concatenates them."
function *(x::String, y::String)
function *(x::AbstractString, y::AbstractString)
# ... [insert secret sauce here] ...
end
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ want to accidentally extend a function that you didn't know existed, because tha
easily cause a bug. This is most likely to happen with a method that takes a common type
like a string or integer, because both you and the other module could define a method to
handle such a common type. If you use ``importall``, then you'll replace the other module's
implementation of ``bar(s::String)`` with your new implementation, which could easily do
implementation of ``bar(s::AbstractString)`` with your new implementation, which could easily do
something completely different (and break all/many future usages of the other functions
in module Foo that depend on calling bar).

Expand Down
2 changes: 1 addition & 1 deletion doc/manual/noteworthy-differences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ and statistical programming. For users coming to Julia from R, these are some
noteworthy differences:

- Julia's single quotes enclose characters, not strings.
- Julia can create substrings by indexing into :obj:`String`\ s. In R, strings
- Julia can create substrings by indexing into strings. In R, strings
must be converted into character vectors before creating substrings.
- In Julia, like Python but unlike R, strings can be created with triple quotes
``""" ... """``. This syntax is convenient for constructing strings that
Expand Down
8 changes: 4 additions & 4 deletions doc/manual/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -985,16 +985,16 @@ which denotes any number of trailing elements:

.. doctest::

julia> isa(("1",), Tuple{String,Vararg{Int}})
julia> isa(("1",), Tuple{AbstractString,Vararg{Int}})
true

julia> isa(("1",1), Tuple{String,Vararg{Int}})
julia> isa(("1",1), Tuple{AbstractString,Vararg{Int}})
true

julia> isa(("1",1,2), Tuple{String,Vararg{Int}})
julia> isa(("1",1,2), Tuple{AbstractString,Vararg{Int}})
true

julia> isa(("1",1,2,3.0), Tuple{String,Vararg{Int}})
julia> isa(("1",1,2,3.0), Tuple{AbstractString,Vararg{Int}})
false

Notice that ``Vararg{T}`` matches zero or more elements of type ``T``.
Expand Down
28 changes: 14 additions & 14 deletions examples/juliatypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ function test_no_diagonal()
@test issub(tupletype(inst(ArrayT,Ty(Integer),1), Ty(Int)),
(@UnionAll T<:Ty(Integer) tupletype(inst(ArrayT,T,1),T)))

@test issub(Ty((Int,String,Vector{Any})),
@test issub(Ty((Int,AbstractString,Vector{Any})),
@UnionAll T tupletype(T, T, inst(ArrayT,T,1)))

@test isequal_type(Ty(Array{Tuple{Integer,Integer},1}),
Expand All @@ -555,7 +555,7 @@ function test_no_diagonal()
@test isequal_type((@UnionAll T tupletype(inst(RefT,T), T)),
(@UnionAll T @UnionAll S<:T @UnionAll R<:S tupletype(inst(RefT,T),R)))

@test issub((@UnionAll S<:Ty(Int) (@UnionAll R<:Ty(String) tupletype(S,R,Ty(Vector{Any})))),
@test issub((@UnionAll S<:Ty(Int) (@UnionAll R<:Ty(AbstractString) tupletype(S,R,Ty(Vector{Any})))),
(@UnionAll T tupletype(T, T, inst(ArrayT,T,1))))
end

Expand Down Expand Up @@ -604,14 +604,14 @@ function test_3()
@test !issub(tupletype(inst(ArrayT,Ty(Integer),1), Ty(Real)),
(@UnionAll T<:Ty(Integer) tupletype(inst(ArrayT,T,1),T)))

@test !issub(Ty((Int,String,Vector{Integer})),
@test !issub(Ty((Int,AbstractString,Vector{Integer})),
@UnionAll T tupletype(T, T, inst(ArrayT,T,1)))
@test !issub(Ty((String,Int,Vector{Integer})),
@test !issub(Ty((AbstractString,Int,Vector{Integer})),
@UnionAll T tupletype(T, T, inst(ArrayT,T,1)))
@test !issub(Ty((Int,String,Vector{Tuple{Integer}})),
@test !issub(Ty((Int,AbstractString,Vector{Tuple{Integer}})),
@UnionAll T tupletype(T,T,inst(ArrayT,tupletype(T),1)))

#@test !issub(Ty((Int,String,Vector{Any})),
#@test !issub(Ty((Int,AbstractString,Vector{Any})),
# @UnionAll T tupletype(T, T, inst(ArrayT,T,1)))

@test isequal_type(Ty(Array{Int,1}), inst(ArrayT, (@UnionAll T<:Ty(Int) T), 1))
Expand Down Expand Up @@ -639,7 +639,7 @@ function test_3()

@test issub(Ty((Integer,Int)), @UnionAll T<:Ty(Integer) @UnionAll S<:T tupletype(T,S))
@test !issub(Ty((Integer,Int)), @UnionAll T<:Ty(Int) @UnionAll S<:T tupletype(T,S))
@test !issub(Ty((Integer,Int)), @UnionAll T<:Ty(String) @UnionAll S<:T tupletype(T,S))
@test !issub(Ty((Integer,Int)), @UnionAll T<:Ty(AbstractString) @UnionAll S<:T tupletype(T,S))

@test issub(Ty((Float32,Array{Float32,1})),
@UnionAll T<:Ty(Real) @UnionAll S<:inst(AbstractArrayT,T,1) tupletype(T,S))
Expand Down Expand Up @@ -687,7 +687,7 @@ end
function test_4()
@test isequal_type(UnionT(BottomT,BottomT), BottomT)

@test issub_strict(Int, Union{Int,String})
@test issub_strict(Int, Union{Int,AbstractString})
@test issub_strict(Union{Int,Int8}, Integer)

@test isequal_type(Union{Int,Int8}, Union{Int,Int8})
Expand Down Expand Up @@ -731,7 +731,7 @@ end
function test_5()
u = Ty(Union{Int8,Int})

@test issub(Ty((String,Array{Int,1})),
@test issub(Ty((AbstractString,Array{Int,1})),
(@UnionAll T UnionT(tupletype(T,inst(ArrayT,T,1)),
tupletype(T,inst(ArrayT,Ty(Int),1)))))

Expand Down Expand Up @@ -773,21 +773,21 @@ end
# tricky type variable lower bounds
function test_6()
# diagonal
#@test !issub((@UnionAll S<:Ty(Int) (@UnionAll R<:Ty(String) tupletype(S,R,Ty(Vector{Any})))),
#@test !issub((@UnionAll S<:Ty(Int) (@UnionAll R<:Ty(AbstractString) tupletype(S,R,Ty(Vector{Any})))),
# (@UnionAll T tupletype(T, T, inst(ArrayT,T,1))))
@test issub((@UnionAll S<:Ty(Int) (@UnionAll R<:Ty(String) tupletype(S,R,Ty(Vector{Any})))),
@test issub((@UnionAll S<:Ty(Int) (@UnionAll R<:Ty(AbstractString) tupletype(S,R,Ty(Vector{Any})))),
(@UnionAll T tupletype(T, T, inst(ArrayT,T,1))))

@test !issub((@UnionAll S<:Ty(Int) (@UnionAll R<:Ty(String) tupletype(S,R,Ty(Vector{Integer})))),
@test !issub((@UnionAll S<:Ty(Int) (@UnionAll R<:Ty(AbstractString) tupletype(S,R,Ty(Vector{Integer})))),
(@UnionAll T tupletype(T, T, inst(ArrayT,T,1))))

t = @UnionAll T tupletype(T,T,inst(RefT,T))
@test isequal_type(t, rename(t))

@test !issub((@UnionAll T tupletype(T,Ty(String),inst(RefT,T))),
@test !issub((@UnionAll T tupletype(T,Ty(AbstractString),inst(RefT,T))),
(@UnionAll T tupletype(T,T,inst(RefT,T))))

@test !issub((@UnionAll T tupletype(T,inst(RefT,T),Ty(String))),
@test !issub((@UnionAll T tupletype(T,inst(RefT,T),Ty(AbstractString))),
(@UnionAll T tupletype(T,inst(RefT,T),T)))

i = Ty(Int); ai = Ty(Integer)
Expand Down
24 changes: 12 additions & 12 deletions examples/typetree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ module TypeTrees

# The node type holds the type of the cuurent node and a dict of subtypes
type TTNode
strname::String
strname::AbstractString
typ::Type
subtypes::Dict{String, TTNode}
subtypes::Dict{AbstractString, TTNode}

TTNode(sname::String, t::Type) = new(sname, t, Dict{String, TTNode}())
TTNode(sname::AbstractString, t::Type) = new(sname, t, Dict{AbstractString, TTNode}())
end

# Add a node to a dict if not added
function add_ttnode(subtypes::Dict{String, TTNode}, sname::String, tnode::TTNode)
function add_ttnode(subtypes::Dict{AbstractString, TTNode}, sname::AbstractString, tnode::TTNode)
ret = get(subtypes, sname, nothing)
(nothing == ret) && (ret = subtypes[sname] = tnode)
ret
end

function add_ttnode(subtypes::Dict{String, TTNode}, sname::String, t::Type)
function add_ttnode(subtypes::Dict{AbstractString, TTNode}, sname::AbstractString, t::Type)
ret = get(subtypes, sname, nothing)
(nothing == ret) && (subtypes[sname] = ret = TTNode(sname, t))
ret
Expand All @@ -34,7 +34,7 @@ typ_name(t) = string(t.name)

# Store a type and its type hierarchy chain
# Recurse till we reach the top level type
function store_type(sname::String, t::Union)
function store_type(sname::AbstractString, t::Union)
suptype = Union
tnode = TTNode(sname, t)

Expand All @@ -51,26 +51,26 @@ function store_type(sname::String, t::Union)
return tnode.subtypes
end

function store_type(sname::String, t::TypeConstructor)
function store_type(sname::AbstractString, t::TypeConstructor)
suptype = t.body
subtypes = store_type(typ_name(suptype), suptype)
tnode = add_ttnode(subtypes, sname, t)
return tnode.subtypes
end

function store_type(sname::String, t::DataType)
function store_type(sname::AbstractString, t::DataType)
suptype = super(t)
subtypes = (suptype != t) ? store_type(typ_name(suptype), suptype) : types_tree
tnode = add_ttnode(subtypes, sname, t)
return tnode.subtypes
end

function store_type(sname::String, t::Tuple)
function store_type(sname::AbstractString, t::Tuple)
tnode = add_ttnode(types_tree, sname, t)
return tnode.subtypes
end

function store_type(sname::String, t)
function store_type(sname::AbstractString, t)
suptype = super(t)
subtypes = (suptype != t) ? store_type(typ_name(suptype), suptype) : types_tree
tnode = add_ttnode(subtypes, sname, t)
Expand All @@ -97,7 +97,7 @@ type_props(typ::DataType) = string("<<",
" size:", typ.size,
" >>")

function print_tree(subtypes::Dict{String, TTNode}, pfx::String="")
function print_tree(subtypes::Dict{AbstractString, TTNode}, pfx::AbstractString="")
for n in sort!([keys(subtypes)...])
v = subtypes[n]
if(n == string(v.typ))
Expand All @@ -113,7 +113,7 @@ end
# TODO: optionally take module names in command line
# TODO: sort output
# TODO: option to list subtrees of type tree, or other symbol types
const types_tree = Dict{String, TTNode}()
const types_tree = Dict{AbstractString, TTNode}()

for m in (Base, Core, Main)
store_all_from(m)
Expand Down
2 changes: 1 addition & 1 deletion src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ static BOOL CALLBACK jl_EnumerateLoadedModulesProc64(
)
{
jl_array_grow_end((jl_array_t*)a, 1);
//XXX: change to jl_arrayset if array storage allocation for Array{String,1} changes:
//XXX: change to jl_arrayset if array storage allocation for Array{ByteString,1} changes:
jl_value_t *v = jl_cstr_to_string(ModuleName);
jl_cellset(a, jl_array_dim0(a)-1, v);
return TRUE;
Expand Down
2 changes: 1 addition & 1 deletion test/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ gstr = GenericString("12");
@test ind2chr(gstr,2)==2

# issue #10307
@test typeof(map(Int16,String[])) == Vector{Int16}
@test typeof(map(Int16,AbstractString[])) == Vector{Int16}

for T in [Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128]
for i in [typemax(T), typemin(T)]
Expand Down

0 comments on commit bffa22f

Please sign in to comment.