From f9d9493e28ba97bce66be520eceecb43825947e3 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Wed, 25 May 2016 12:10:17 -0700 Subject: [PATCH 1/6] Remove instances of deprecated Dict comprehension syntax why weren't these causing warnings? --- base/LineEdit.jl | 12 ++++++------ base/pkg/resolve.jl | 2 +- base/pkg/resolve/interface.jl | 2 +- doc/devdocs/ast.rst | 2 -- doc/stdlib/collections.rst | 4 ++-- test/perf/perfcomp.jl | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/base/LineEdit.jl b/base/LineEdit.jl index c7af86e2dc69f..b37adef082ed9 100644 --- a/base/LineEdit.jl +++ b/base/LineEdit.jl @@ -909,7 +909,7 @@ function keymap{D<:Dict}(keymaps::Array{D}) end const escape_defaults = merge!( - AnyDict([Char(i) => nothing for i=vcat(1:26, 28:31)]), # Ignore control characters by default + AnyDict(Char(i) => nothing for i=vcat(1:26, 28:31)), # Ignore control characters by default AnyDict( # And ignore other escape sequences by default "\e*" => nothing, "\e[*" => nothing, @@ -941,9 +941,9 @@ const escape_defaults = merge!( "\eOF" => KeyAlias("\e[F"), ), # set mode commands - AnyDict(["\e[$(c)h" => nothing for c in 1:20]), + AnyDict("\e[$(c)h" => nothing for c in 1:20), # reset mode commands - AnyDict(["\e[$(c)l" => nothing for c in 1:20]) + AnyDict("\e[$(c)l" => nothing for c in 1:20) ) function write_response_buffer(s::PromptState, data) @@ -1456,11 +1456,11 @@ const prefix_history_keymap = merge!( "\e[200~" => "*" ), # VT220 editing commands - AnyDict(["\e[$(n)~" => "*" for n in 1:8]), + AnyDict("\e[$(n)~" => "*" for n in 1:8), # set mode commands - AnyDict(["\e[$(c)h" => "*" for c in 1:20]), + AnyDict("\e[$(c)h" => "*" for c in 1:20), # reset mode commands - AnyDict(["\e[$(c)l" => "*" for c in 1:20]) + AnyDict("\e[$(c)l" => "*" for c in 1:20) ) function setup_prefix_keymap(hp, parent_prompt) diff --git a/base/pkg/resolve.jl b/base/pkg/resolve.jl index 84685330f06e7..8725bd482e882 100644 --- a/base/pkg/resolve.jl +++ b/base/pkg/resolve.jl @@ -75,7 +75,7 @@ function sanity_check(deps::Dict{String,Dict{VersionNumber,Available}}, nv = length(vers) - svdict = (Tuple{String,VersionNumber}=>Int)[ vers[i][1:2]=>i for i = 1:nv ] + svdict = Dict{Tuple{String,VersionNumber},Int}(vers[i][1:2]=>i for i = 1:nv) checked = falses(nv) diff --git a/base/pkg/resolve/interface.jl b/base/pkg/resolve/interface.jl index d7d038b66c748..dd23cca5cf4a9 100644 --- a/base/pkg/resolve/interface.jl +++ b/base/pkg/resolve/interface.jl @@ -49,7 +49,7 @@ type Interface np = length(pkgs) # generate pdict - pdict = (String=>Int)[ pkgs[i] => i for i = 1:np ] + pdict = Dict{String,Int}(pkgs[i] => i for i = 1:np) # generate spp and pvers spp = Array{Int}(np) diff --git a/doc/devdocs/ast.rst b/doc/devdocs/ast.rst index 07290fe361ba0..b0bf7063d2a18 100644 --- a/doc/devdocs/ast.rst +++ b/doc/devdocs/ast.rst @@ -294,8 +294,6 @@ a{b;c} (curly a (parameters c) b) [x y; z t] (vcat (row x y) (row z t)) [x for y in z, a in b] (comprehension x (= y z) (= a b)) T[x for y in z] (typed_comprehension T x (= y z)) -[a=>b for x in y] (dict_comprehension (=> a b) (= x y)) -(k=>v)[a=>b for x in y] (typed_dict_comprehension (=> k v) (=> a b) (= x y)) (a, b, c) (tuple a b c) (a; b; c) (block a (block b c)) ======================= ==================================== diff --git a/doc/stdlib/collections.rst b/doc/stdlib/collections.rst index fcbe58b194c28..2dfd0ff9bb0bb 100644 --- a/doc/stdlib/collections.rst +++ b/doc/stdlib/collections.rst @@ -722,8 +722,8 @@ Associative Collections To explicitly specify types use the syntax ``Dict{KeyType,ValueType}(...)``. For example, ``Dict{String,Int32}("A"=>1, "B"=>2)``. -As with :obj:`Array`\ s, :obj:`Dict`\ s may be created with comprehensions. For example, -``[i => f(i) for i = 1:10]``. +:obj:`Dict`\ s may also be created with generators. For example, +``Dict(i => f(i) for i = 1:10)``. Given a dictionary ``D``, the syntax ``D[x]`` returns the value of key ``x`` (if it exists) or throws an error, and ``D[x] = y`` stores the key-value pair ``x => y`` in ``D`` (replacing any existing value for the key ``x``). Multiple arguments to ``D[...]`` are converted to tuples; for example, the syntax ``D[x,y]`` is equivalent to ``D[(x,y)]``, i.e. it refers to the value keyed by the tuple ``(x,y)``. diff --git a/test/perf/perfcomp.jl b/test/perf/perfcomp.jl index d4a0045253a75..7575107d90948 100644 --- a/test/perf/perfcomp.jl +++ b/test/perf/perfcomp.jl @@ -7,7 +7,7 @@ # The file format is the output of running `make` in this directory. function readperf(f) - [ rstrip(l[1:19])=>[parse(Float64,l[20:27]),parse(Float64,l[29:36]),parse(Float64,l[38:45]),parse(Float64,l[47:54])] for l in eachline(f) ] + Dict(rstrip(l[1:19])=>[parse(Float64,l[20:27]),parse(Float64,l[29:36]),parse(Float64,l[38:45]),parse(Float64,l[47:54])] for l in eachline(f)) end function main() From 401cc858f3770b112453848ccb6a53457c3ad1b6 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Wed, 25 May 2016 12:03:29 -0700 Subject: [PATCH 2/6] Fix some sphinx issues add quotes around (0,0) Adjust grammar in some comments and docstrings --- base/libgit2/callbacks.jl | 29 +++++++++++++++-------------- base/libgit2/types.jl | 10 ++++++---- base/sysinfo.jl | 2 +- doc/devdocs/ast.rst | 14 ++++++++------ doc/manual/interfaces.rst | 1 + doc/stdlib/arrays.rst | 1 + doc/stdlib/base.rst | 2 +- src/dump.c | 2 +- 8 files changed, 34 insertions(+), 27 deletions(-) diff --git a/base/libgit2/callbacks.jl b/base/libgit2/callbacks.jl index 2250140714a87..a8b637a04688d 100644 --- a/base/libgit2/callbacks.jl +++ b/base/libgit2/callbacks.jl @@ -27,27 +27,28 @@ end """Credentials callback function Function provides different credential acquisition functionality w.r.t. a connection protocol. -If payload is provided then `payload_ptr` should contain `LibGit2.AbstractCredentials` object. +If a payload is provided then `payload_ptr` should contain a `LibGit2.AbstractCredentials` object. -For `LibGit2.Consts.CREDTYPE_USERPASS_PLAINTEXT` type, if payload contains fields: +For `LibGit2.Consts.CREDTYPE_USERPASS_PLAINTEXT` type, if the payload contains fields: `user` & `pass`, they are used to create authentication credentials. -Empty `user` name and `pass`word trigger authentication error. +Empty `user` name and `pass`word trigger an authentication error. -For `LibGit2.Consts.CREDTYPE_SSH_KEY` type, if payload contains fields: +For `LibGit2.Consts.CREDTYPE_SSH_KEY` type, if the payload contains fields: `user`, `prvkey`, `pubkey` & `pass`, they are used to create authentication credentials. -Empty `user` name triggers authentication error. +Empty `user` name triggers an authentication error. -Order of credential checks (if supported): -- ssh key pair (ssh-agent if specified in payload's `usesshagent` field) +Credentials are checked in the following order (if supported): +- ssh key pair (`ssh-agent` if specified in payload's `usesshagent` field) - plain text -**Note**: Due to the specifics of `libgit2` authentication procedure, when authentication fails, -this function is called again without any indication whether authentication was successful or not. -To avoid an infinite loop from repeatedly using the same faulty credentials, -`checkused!` function can be called to test if credentials were used if call returns `true` value. -Used credentials trigger user prompt for (re)entering required information. -`UserPasswordCredentials` and `CachedCredentials` are implemented using a call counting strategy -that prevents repeated usage of faulty credentials. +**Note**: Due to the specifics of the `libgit2` authentication procedure, when +authentication fails, this function is called again without any indication whether +authentication was successful or not. To avoid an infinite loop from repeatedly +using the same faulty credentials, the `checkused!` function can be called. This +function returns `true` if the credentials were used. +Using credentials triggers a user prompt for (re)entering required information. +`UserPasswordCredentials` and `CachedCredentials` are implemented using a call +counting strategy that prevents repeated usage of faulty credentials. """ function credentials_callback(cred::Ptr{Ptr{Void}}, url_ptr::Cstring, username_ptr::Cstring, diff --git a/base/libgit2/types.jl b/base/libgit2/types.jl index 690264cb69577..919c2866bc4f3 100644 --- a/base/libgit2/types.jl +++ b/base/libgit2/types.jl @@ -63,7 +63,7 @@ function Base.getindex(p::AbstractCredentials, keys...) end return nothing end -"Sets credentials with `key` parameter with value" +"Sets credentials with `key` parameter to a value" function Base.setindex!(p::AbstractCredentials, val, keys...) for k in keys ks = Symbol(k) @@ -73,7 +73,7 @@ function Base.setindex!(p::AbstractCredentials, val, keys...) end "Checks if credentials were used" checkused!(p::AbstractCredentials) = true -"Resets credentials for another usage" +"Resets credentials for another use" reset!(p::AbstractCredentials, cnt::Int=3) = nothing immutable CheckoutOptions @@ -745,7 +745,8 @@ type CachedCredentials <: AbstractCredentials count::Int # authentication failure protection count CachedCredentials() = new(Dict{AbstractString,SSHCredentials}(),3) end -"Returns specific credential parameter value: first index is a credential parameter name, second index is a host name (with schema)" +"Returns specific credential parameter value: first index is a credential +parameter name, second index is a host name (with schema)" function Base.getindex(p::CachedCredentials, keys...) length(keys) != 2 && return nothing key, host = keys @@ -758,7 +759,8 @@ function Base.getindex(p::CachedCredentials, keys...) end return nothing end -"Sets specific credential parameter value: first index is a credential parameter name, second index is a host name (with schema)" +"Sets specific credential parameter value: first index is a credential +parameter name, second index is a host name (with schema)" function Base.setindex!(p::CachedCredentials, val, keys...) length(keys) != 2 && return nothing key, host = keys diff --git a/base/sysinfo.jl b/base/sysinfo.jl index 2c4b26204fbb4..56e9d6569bd9e 100644 --- a/base/sysinfo.jl +++ b/base/sysinfo.jl @@ -180,7 +180,7 @@ end windows_version() Returns the version number for the Windows NT Kernel as a (major, minor) pair, -or (0, 0) if this is not running on Windows. +or `(0, 0)` if this is not running on Windows. """ windows_version diff --git a/doc/devdocs/ast.rst b/doc/devdocs/ast.rst index b0bf7063d2a18..50eda4da0dfe0 100644 --- a/doc/devdocs/ast.rst +++ b/doc/devdocs/ast.rst @@ -178,12 +178,14 @@ These symbols appear in the ``head`` field of ``Expr``\s in lowered form. metadata. ``args[1]`` is typically a symbol specifying the kind of metadata, and the rest of the arguments are free-form. The following kinds of metadata are commonly used: - - ``:inline`` and ``:noinline``: Inlining hints. - - ``:push_loc``: enters a sequence of statements from a specified source location. - ``args[2]`` specifies a filename, as a symbol. - ``args[3]`` optionally specifies the name of an (inlined) function that originally - contained the code. - - ``:pop_loc``: returns to the source location before the matching ``:push_loc``. + + ``:inline`` and ``:noinline``: Inlining hints. + + ``:push_loc``: enters a sequence of statements from a specified source location. + - ``args[2]`` specifies a filename, as a symbol. + - ``args[3]`` optionally specifies the name of an (inlined) function that originally contained the code. + + ``:pop_loc``: returns to the source location before the matching ``:push_loc``. LambdaInfo ~~~~~~~~~~ diff --git a/doc/manual/interfaces.rst b/doc/manual/interfaces.rst index eb03044381eea..041cca8842797 100644 --- a/doc/manual/interfaces.rst +++ b/doc/manual/interfaces.rst @@ -166,6 +166,7 @@ Methods to implement :func:`similar(A, dims::NTuple{Int}) ` ``similar(A, eltype(A), dims)`` Return a mutable array with the same element type and the specified dimensions :func:`similar(A, ::Type{S}, dims::NTuple{Int}) ` ``Array{S}(dims)`` Return a mutable array with the specified element type and dimensions ============================================================================ ============================================ ======================================================================================= + If a type is defined as a subtype of ``AbstractArray``, it inherits a very large set of rich behaviors including iteration and multidimensional indexing built on top of single-element access. See the :ref:`arrays manual page ` and :ref:`standard library section ` for more supported methods. A key part in defining an ``AbstractArray`` subtype is :func:`Base.linearindexing`. Since indexing is such an important part of an array and often occurs in hot loops, it's important to make both indexing and indexed assignment as efficient as possible. Array data structures are typically defined in one of two ways: either it most efficiently accesses its elements using just one index (linear indexing) or it intrinsically accesses the elements with indices specified for every dimension. These two modalities are identified by Julia as ``Base.LinearFast()`` and ``Base.LinearSlow()``. Converting a linear index to multiple indexing subscripts is typically very expensive, so this provides a traits-based mechanism to enable efficient generic code for all array types. diff --git a/doc/stdlib/arrays.rst b/doc/stdlib/arrays.rst index 0250fc82b1933..24ce750e2beeb 100644 --- a/doc/stdlib/arrays.rst +++ b/doc/stdlib/arrays.rst @@ -995,3 +995,4 @@ dense counterparts. The following functions are specific to sparse arrays. # perform sparse wizardry... end end + diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index a12441ef99122..06d850d7531d0 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -1011,7 +1011,7 @@ System .. Docstring generated from Julia source - Returns the version number for the Windows NT Kernel as a (major, minor) pair, or (0, 0) if this is not running on Windows. + Returns the version number for the Windows NT Kernel as a (major, minor) pair, or ``(0, 0)`` if this is not running on Windows. .. function:: @static diff --git a/src/dump.c b/src/dump.c index c431365ab4c26..44482272635d2 100644 --- a/src/dump.c +++ b/src/dump.c @@ -2405,7 +2405,7 @@ void jl_init_serializer(void) (void*)Int32_tag, (void*)Array1d_tag, (void*)Singleton_tag, jl_module_type, jl_tvar_type, jl_lambda_info_type, jl_method_type, (void*)CommonSym_tag, (void*)NearbyGlobal_tag, jl_globalref_type, - // everything above here represents a class of object rather only than a literal + // everything above here represents a class of object rather than only a literal jl_emptysvec, jl_emptytuple, jl_false, jl_true, jl_nothing, jl_any_type, call_sym, goto_ifnot_sym, return_sym, body_sym, line_sym, From cbb4c6815d033b903abe33284bdcc5bf9a8f599e Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Wed, 25 May 2016 12:42:28 -0700 Subject: [PATCH 3/6] Revert b9e165b90a7057697d1062024f5c329465a52cf9 see discussion in #16561, deprecations should be flagged, found, and removed in base - if you need to include code with deprecations in userimg.jl, then add --depwarn=no manually when building that custom image --- src/ast.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ast.c b/src/ast.c index ee736cc18c9b6..3a97b4b975cbf 100644 --- a/src/ast.c +++ b/src/ast.c @@ -219,10 +219,7 @@ static void jl_init_ast_ctx(jl_ast_context_t *ast_ctx) jl_ast_ctx(fl_ctx)->slot_sym = symbol(fl_ctx, "slot"); // Enable / disable syntax deprecation warnings - // Disable in imaging mode to avoid i/o errors (#10727) - if (jl_generating_output()) - jl_parse_depwarn_(fl_ctx, 0); - else if (jl_options.depwarn == JL_OPTIONS_DEPWARN_ERROR) + if (jl_options.depwarn == JL_OPTIONS_DEPWARN_ERROR) jl_parse_deperror(fl_ctx, 1); else jl_parse_depwarn_(fl_ctx, (int)jl_options.depwarn); From bce068e895614c539c6b3fa991cab5bd8d7ddde6 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Wed, 25 May 2016 12:59:45 -0700 Subject: [PATCH 4/6] Clean up call deprecation docs and remaining uses there are a few more in the FFTW deprecations that should be removed soon --- base/docs/helpdb/Base.jl | 8 -------- base/gmp.jl | 10 +++++----- base/mpfr.jl | 8 ++++---- base/rounding.jl | 2 +- doc/stdlib/base.rst | 6 ------ 5 files changed, 10 insertions(+), 24 deletions(-) diff --git a/base/docs/helpdb/Base.jl b/base/docs/helpdb/Base.jl index 192885623dbb3..d76761fd5304f 100644 --- a/base/docs/helpdb/Base.jl +++ b/base/docs/helpdb/Base.jl @@ -3344,14 +3344,6 @@ The lowest value representable by the given (real) numeric DataType `T`. """ typemin -""" - call(x, args...) - -If `x` is not a `Function`, then `x(args...)` is equivalent to `call(x, args...)`. This -means that function-like behavior can be added to any type by defining new `call` methods. -""" -call - """ countfrom(start=1, step=1) diff --git a/base/gmp.jl b/base/gmp.jl index b5edee0436f5a..fab114126cf74 100644 --- a/base/gmp.jl +++ b/base/gmp.jl @@ -201,24 +201,24 @@ function convert{T<:Signed}(::Type{T}, x::BigInt) end -function call(::Type{Float64}, n::BigInt, ::RoundingMode{:ToZero}) +function (::Type{Float64})(n::BigInt, ::RoundingMode{:ToZero}) ccall((:__gmpz_get_d, :libgmp), Float64, (Ptr{BigInt},), &n) end -function call{T<:Union{Float16,Float32}}(::Type{T}, n::BigInt, ::RoundingMode{:ToZero}) +function (::Type{T}){T<:Union{Float16,Float32}}(n::BigInt, ::RoundingMode{:ToZero}) T(Float64(n,RoundToZero),RoundToZero) end -function call{T<:CdoubleMax}(::Type{T}, n::BigInt, ::RoundingMode{:Down}) +function (::Type{T}){T<:CdoubleMax}(n::BigInt, ::RoundingMode{:Down}) x = T(n,RoundToZero) x > n ? prevfloat(x) : x end -function call{T<:CdoubleMax}(::Type{T}, n::BigInt, ::RoundingMode{:Up}) +function (::Type{T}){T<:CdoubleMax}(n::BigInt, ::RoundingMode{:Up}) x = T(n,RoundToZero) x < n ? nextfloat(x) : x end -function call{T<:CdoubleMax}(::Type{T}, n::BigInt, ::RoundingMode{:Nearest}) +function (::Type{T}){T<:CdoubleMax}(n::BigInt, ::RoundingMode{:Nearest}) x = T(n,RoundToZero) if maxintfloat(T) <= abs(x) < T(Inf) r = n-BigInt(x) diff --git a/base/mpfr.jl b/base/mpfr.jl index 2c80b7568f0e6..df36cd4089875 100644 --- a/base/mpfr.jl +++ b/base/mpfr.jl @@ -177,13 +177,13 @@ convert(::Type{Float32}, x::BigFloat) = # TODO: avoid double rounding convert(::Type{Float16}, x::BigFloat) = convert(Float16, convert(Float32, x)) -call(::Type{Float64}, x::BigFloat, r::RoundingMode) = +(::Type{Float64})(x::BigFloat, r::RoundingMode) = ccall((:mpfr_get_d,:libmpfr), Float64, (Ptr{BigFloat},Int32), &x, to_mpfr(r)) -call(::Type{Float32}, x::BigFloat, r::RoundingMode) = +(::Type{Float32})(x::BigFloat, r::RoundingMode) = ccall((:mpfr_get_flt,:libmpfr), Float32, (Ptr{BigFloat},Int32), &x, to_mpfr(r)) # TODO: avoid double rounding -call(::Type{Float16}, x::BigFloat, r::RoundingMode) = - convert(Float16, call(Float32, x, r)) +(::Type{Float16})(x::BigFloat, r::RoundingMode) = + convert(Float16, Float32(x, r)) promote_rule{T<:Real}(::Type{BigFloat}, ::Type{T}) = BigFloat promote_rule{T<:AbstractFloat}(::Type{BigInt},::Type{T}) = BigFloat diff --git a/base/rounding.jl b/base/rounding.jl index 7d8c17b40d936..c3a38659f3710 100644 --- a/base/rounding.jl +++ b/base/rounding.jl @@ -67,7 +67,7 @@ end # Assumes conversion is performed by rounding to nearest value. # To avoid ambiguous dispatch with methods in mpfr.jl: -call{T<:AbstractFloat}(::Type{T},x::Real,r::RoundingMode) = _convert_rounding(T,x,r) +(::Type{T}){T<:AbstractFloat}(x::Real,r::RoundingMode) = _convert_rounding(T,x,r) _convert_rounding{T<:AbstractFloat}(::Type{T},x::Real,r::RoundingMode{:Nearest}) = convert(T,x) function _convert_rounding{T<:AbstractFloat}(::Type{T},x::Real,r::RoundingMode{:Down}) diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index 06d850d7531d0..edfd0a22fbf9b 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -668,12 +668,6 @@ Generic Functions julia> [1:5;] |> x->x.^2 |> sum |> inv 0.01818181818181818 -.. function:: call(x, args...) - - .. Docstring generated from Julia source - - If ``x`` is not a ``Function``\ , then ``x(args...)`` is equivalent to ``call(x, args...)``\ . This means that function-like behavior can be added to any type by defining new ``call`` methods. - Syntax ------ From 3fcea09aec7bbe7879dcdffa1ed14436829fa162 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Sun, 22 May 2016 16:10:39 -0700 Subject: [PATCH 5/6] Remove docs for deprecated functions msync, iseltype, inf, nan, complement, complement! etc etc etc --- base/docs/helpdb/Base.jl | 45 +++----------------------- base/unicode/utf8proc.jl | 2 +- contrib/BBEditTextWrangler-julia.plist | 40 +++++------------------ contrib/julia.lang | 6 ++-- contrib/julia.xml | 2 +- doc/DocCheck.jl | 2 +- doc/stdlib/arrays.rst | 6 ---- doc/stdlib/base.rst | 2 +- doc/stdlib/collections.rst | 12 ------- doc/stdlib/io-network.rst | 4 +-- doc/stdlib/libc.rst | 16 --------- doc/stdlib/numbers.rst | 12 ------- doc/stdlib/test.rst | 2 +- 13 files changed, 23 insertions(+), 128 deletions(-) diff --git a/base/docs/helpdb/Base.jl b/base/docs/helpdb/Base.jl index d76761fd5304f..8e5ff4ad9eb88 100644 --- a/base/docs/helpdb/Base.jl +++ b/base/docs/helpdb/Base.jl @@ -2901,7 +2901,7 @@ showcompact isleaftype(T) Determine whether `T` is a concrete type that can have instances, meaning its only subtypes -are itself and `None` (but `T` itself is not `None`). +are itself and `Union{}` (but `T` itself is not `Union{}`). """ isleaftype @@ -3967,7 +3967,7 @@ colon Base64EncodePipe(ostream) Returns a new write-only I/O stream, which converts any bytes written to it into -base64-encoded ASCII bytes written to `ostream`. Calling `close` on the `Base64Pipe` stream +base64-encoded ASCII bytes written to `ostream`. Calling `close` on the `Base64EncodePipe` stream is necessary to complete the encoding (but does not close `ostream`). """ Base64EncodePipe @@ -6324,13 +6324,6 @@ Compute sine of `x`, where `x` is in degrees. """ sind -""" - iseltype(A,T) - -Tests whether `A` or its elements are of type `T`. -""" -iseltype - """ min(x, y, ...) @@ -7266,13 +7259,6 @@ lexicographically comparable types, and `lexless` will call `lexcmp` by default. """ lexcmp -""" - inf(f) - -Returns positive infinity of the floating point type `f` or of the same floating point type as `f`. -""" -inf - """ isupper(c::Union{Char,AbstractString}) -> Bool @@ -7638,13 +7624,6 @@ julia> "Hello " * "world" """ Base.:(*)(s::AbstractString, t::AbstractString) -""" - complement!(s) - -Mutates [`IntSet`](:obj:`IntSet`) `s` into its set-complement. -""" -complement! - """ slice(A, inds...) @@ -7957,13 +7936,6 @@ Cumulative product of `A` along a dimension, storing the result in `B`. The dime """ cumprod! -""" - complement(s) - -Returns the set-complement of [`IntSet`](:obj:`IntSet`) `s`. -""" -complement - """ rethrow([e]) @@ -8598,8 +8570,8 @@ cos base64encode(args...) Given a `write`-like function `writefunc`, which takes an I/O stream as its first argument, -`base64(writefunc, args...)` calls `writefunc` to write `args...` to a base64-encoded -string, and returns the string. `base64(args...)` is equivalent to `base64(write, args...)`: +`base64encode(writefunc, args...)` calls `writefunc` to write `args...` to a base64-encoded +string, and returns the string. `base64encode(args...)` is equivalent to `base64encode(write, args...)`: it converts its arguments into bytes using the standard `write` functions and returns the base64-encoded string. """ @@ -9528,7 +9500,7 @@ Matrix trace. trace """ - runtests([tests=["all"] [, numcores=iceil(Sys.CPU_CORES / 2) ]]) + runtests([tests=["all"] [, numcores=ceil(Integer, Sys.CPU_CORES / 2) ]]) Run the Julia unit tests listed in `tests`, which can be either a string or an array of strings, using `numcores` processors. (not exported) @@ -9637,13 +9609,6 @@ Unicode string.) """ reverseind -""" - nan(f) - -Returns NaN (not-a-number) of the floating point type `f` or of the same floating point type as `f` -""" -nan - """ float(x) diff --git a/base/unicode/utf8proc.jl b/base/unicode/utf8proc.jl index c6ce45a6d0481..60a612257b064 100644 --- a/base/unicode/utf8proc.jl +++ b/base/unicode/utf8proc.jl @@ -10,7 +10,7 @@ export isgraphemebreak # also exported by Base: export normalize_string, graphemes, is_assigned_char, charwidth, isvalid, islower, isupper, isalpha, isdigit, isnumber, isalnum, - iscntrl, ispunct, isspace, isprint, isgraph, isblank + iscntrl, ispunct, isspace, isprint, isgraph # whether codepoints are valid Unicode scalar values, i.e. 0-0xd7ff, 0xe000-0x10ffff isvalid(::Type{Char}, ch::Unsigned) = !((ch - 0xd800 < 0x800) | (ch > 0x10ffff)) diff --git a/contrib/BBEditTextWrangler-julia.plist b/contrib/BBEditTextWrangler-julia.plist index fcb01a678c577..2932dfc963121 100644 --- a/contrib/BBEditTextWrangler-julia.plist +++ b/contrib/BBEditTextWrangler-julia.plist @@ -179,13 +179,11 @@ atreplinit backtrace baremodule - base64 base64decode base64encode base basename begin - beginswith besselh besselhx besseli @@ -272,8 +270,6 @@ code_warntype collect colon - complement! - complement complex128 complex32 complex64 @@ -482,7 +478,6 @@ fullname function functionloc - functionlocs gamma gc gc_disable @@ -528,7 +523,6 @@ hton hvcat hypot - iceil idct! idct identity @@ -537,7 +531,6 @@ ifft! ifft ifftshift - ifloor ignorestatus im imag @@ -578,7 +571,6 @@ ipermute! ipermutedims irfft - iround is_apple is_assigned_char is_bsd @@ -592,7 +584,6 @@ isascii isassigned isbits - isblank isblockdev ischardev iscntrl @@ -601,7 +592,6 @@ isdigit isdir isdirpath - iseltype isempty isequal iseven @@ -660,7 +650,6 @@ isvalid iswritable isxdigit - itrunc join joinpath keys @@ -759,7 +748,6 @@ module module_name module_parent - msync mtime muladd mv @@ -885,8 +873,6 @@ radians2degrees rand! rand - randbool! - randbool randcycle randexp! randexp @@ -1027,7 +1013,6 @@ sinpi size sizehint! - sizehint sizeof skip skipchars @@ -1144,12 +1129,6 @@ typemin typeof ucfirst - uint128 - uint16 - uint32 - uint64 - uint8 - uint unescape_string union! union @@ -1251,7 +1230,6 @@ At_rdiv_Bt Base64DecodePipe Base64EncodePipe - Base64Pipe Base Bidiagonal BigFloat @@ -1392,8 +1370,6 @@ NaN32 NaN64 NaN - None - Nothing Nullable NullException Number @@ -1478,8 +1454,8 @@ SymTridiagonal Sys SystemError + TCPSocket Task - TcpSocket Test Text TextDisplay @@ -1492,13 +1468,13 @@ Tuple Type TypeError - UdpSocket - Uint128 - Uint16 - Uint32 - Uint64 - Uint8 - Uint + UDPSocket + UInt128 + UInt16 + UInt32 + UInt64 + UInt8 + UInt UnicodeError UniformScaling UnionType diff --git a/contrib/julia.lang b/contrib/julia.lang index 130567c81e1cb..fcef24b3e5d9e 100644 --- a/contrib/julia.lang +++ b/contrib/julia.lang @@ -284,8 +284,8 @@ Hermitian Hessenberg IO(Buffer|Stream)? + IPAddr|IPv[46] InetAddr - IpAddr|IPv[46] (Key|Value)Iterator LambdaInfo LocalProcess @@ -320,14 +320,14 @@ StateUpdate StaticVarInfo Symbol(Node)? + TCPSocket TTY Task - TcpSocket TmStruct Top(Node)? Triangular UV(Handle|PollingWatcher|Stream) - UdpSocket + UDPSocket Undef(RefTag)? VarTable Vararg diff --git a/contrib/julia.xml b/contrib/julia.xml index 2bb6803ea5756..8ff722197a280 100644 --- a/contrib/julia.xml +++ b/contrib/julia.xml @@ -180,8 +180,8 @@ Symbol Symmetric SymTridiagonal + TCPSocket Task - TcpSocket TimeoutAsyncWork TmStruct Triangular diff --git a/doc/DocCheck.jl b/doc/DocCheck.jl index a0e7a91d7a47f..07881743215bc 100644 --- a/doc/DocCheck.jl +++ b/doc/DocCheck.jl @@ -54,7 +54,7 @@ function undocumented_by_file(m::Module) for (f,_) in undocumented(m) s = string(f) try - for (file, line) in functionlocs(eval(f)) + for (file, line) in map(functionloc,methods(eval(f))) if startswith(file, JULIA_HOME) file = replace(file, JULIA_HOME, "\$JULIA_HOME", 1) end diff --git a/doc/stdlib/arrays.rst b/doc/stdlib/arrays.rst index 24ce750e2beeb..44b0060c0ebee 100644 --- a/doc/stdlib/arrays.rst +++ b/doc/stdlib/arrays.rst @@ -31,12 +31,6 @@ Basic functions julia> size(A,3,2) (4,3) -.. function:: iseltype(A,T) - - .. Docstring generated from Julia source - - Tests whether ``A`` or its elements are of type ``T``\ . - .. function:: length(A) -> Integer .. Docstring generated from Julia source diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index edfd0a22fbf9b..686f83311c87f 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -577,7 +577,7 @@ Types .. Docstring generated from Julia source - Determine whether ``T`` is a concrete type that can have instances, meaning its only subtypes are itself and ``None`` (but ``T`` itself is not ``None``\ ). + Determine whether ``T`` is a concrete type that can have instances, meaning its only subtypes are itself and ``Union{}`` (but ``T`` itself is not ``Union{}``\ ). .. function:: typejoin(T, S) diff --git a/doc/stdlib/collections.rst b/doc/stdlib/collections.rst index 2dfd0ff9bb0bb..095277f615441 100644 --- a/doc/stdlib/collections.rst +++ b/doc/stdlib/collections.rst @@ -968,18 +968,6 @@ Set-Like Collections Construct the symmetric difference of sets ``s1`` and ``s2``\ , storing the result in ``s1``\ . -.. function:: complement(s) - - .. Docstring generated from Julia source - - Returns the set-complement of :obj:`IntSet` ``s``\ . - -.. function:: complement!(s) - - .. Docstring generated from Julia source - - Mutates :obj:`IntSet` ``s`` into its set-complement. - .. function:: intersect!(s1, s2) .. Docstring generated from Julia source diff --git a/doc/stdlib/io-network.rst b/doc/stdlib/io-network.rst index c0013a20d9d14..f479e75294d77 100644 --- a/doc/stdlib/io-network.rst +++ b/doc/stdlib/io-network.rst @@ -630,7 +630,7 @@ Text I/O .. Docstring generated from Julia source - Returns a new write-only I/O stream, which converts any bytes written to it into base64-encoded ASCII bytes written to ``ostream``\ . Calling ``close`` on the ``Base64Pipe`` stream is necessary to complete the encoding (but does not close ``ostream``\ ). + Returns a new write-only I/O stream, which converts any bytes written to it into base64-encoded ASCII bytes written to ``ostream``\ . Calling ``close`` on the ``Base64EncodePipe`` stream is necessary to complete the encoding (but does not close ``ostream``\ ). .. function:: Base64DecodePipe(istream) @@ -643,7 +643,7 @@ Text I/O .. Docstring generated from Julia source - Given a ``write``\ -like function ``writefunc``\ , which takes an I/O stream as its first argument, ``base64(writefunc, args...)`` calls ``writefunc`` to write ``args...`` to a base64-encoded string, and returns the string. ``base64(args...)`` is equivalent to ``base64(write, args...)``\ : it converts its arguments into bytes using the standard ``write`` functions and returns the base64-encoded string. + Given a ``write``\ -like function ``writefunc``\ , which takes an I/O stream as its first argument, ``base64encode(writefunc, args...)`` calls ``writefunc`` to write ``args...`` to a base64-encoded string, and returns the string. ``base64encode(args...)`` is equivalent to ``base64encode(write, args...)``\ : it converts its arguments into bytes using the standard ``write`` functions and returns the base64-encoded string. .. function:: base64decode(string) diff --git a/doc/stdlib/libc.rst b/doc/stdlib/libc.rst index 2f0cd68a9d404..5c1cb2df9ee10 100644 --- a/doc/stdlib/libc.rst +++ b/doc/stdlib/libc.rst @@ -88,19 +88,3 @@ Flushes the C ``stdout`` and ``stderr`` streams (which may have been written to by external C code). -.. function:: msync(ptr, len, [flags]) - - .. Docstring generated from Julia source - - Forces synchronization of the :func:`mmap`\ ped memory region from ``ptr`` to ``ptr+len``\ . Flags defaults to ``MS_SYNC``\ , but can be a combination of ``MS_ASYNC``\ , ``MS_SYNC``\ , or ``MS_INVALIDATE``\ . See your platform man page for specifics. The flags argument is not valid on Windows. - - You may not need to call ``msync``\ , because synchronization is performed at intervals automatically by the operating system. However, you can call this directly if, for example, you are concerned about losing the result of a long-running calculation. - -.. variable:: MS_ASYNC - MS_SYNC - MS_INVALIDATE - - .. Docstring generated from Julia source - - Enum constants for :func:`msync`\ . See your platform man page for details. (not available on Windows). - diff --git a/doc/stdlib/numbers.rst b/doc/stdlib/numbers.rst index 2b55a16149bab..0d21d17d99e90 100644 --- a/doc/stdlib/numbers.rst +++ b/doc/stdlib/numbers.rst @@ -243,18 +243,6 @@ General Number Functions and Constants Test whether a floating point number is not a number (NaN). -.. function:: inf(f) - - .. Docstring generated from Julia source - - Returns positive infinity of the floating point type ``f`` or of the same floating point type as ``f``\ . - -.. function:: nan(f) - - .. Docstring generated from Julia source - - Returns NaN (not-a-number) of the floating point type ``f`` or of the same floating point type as ``f`` - .. function:: nextfloat(x::AbstractFloat) .. Docstring generated from Julia source diff --git a/doc/stdlib/test.rst b/doc/stdlib/test.rst index 1fcd043a463e2..c4812b96608ee 100644 --- a/doc/stdlib/test.rst +++ b/doc/stdlib/test.rst @@ -12,7 +12,7 @@ binary install, you can run the test suite using ``Base.runtests()``. .. currentmodule:: Base -.. function:: runtests([tests=["all"] [, numcores=iceil(Sys.CPU_CORES / 2) ]]) +.. function:: runtests([tests=["all"] [, numcores=ceil(Integer, Sys.CPU_CORES / 2) ]]) .. Docstring generated from Julia source From 60c269d9e38f0416635cef8d7e543dcc54bd98b4 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Wed, 25 May 2016 14:05:53 -0700 Subject: [PATCH 6/6] Many more deprecation doc cleanups --- base/deprecated.jl | 2 ++ base/docs/helpdb/Base.jl | 9 +---- base/exports.jl | 2 -- base/promotion.jl | 1 - base/strings/types.jl | 2 +- contrib/BBEditTextWrangler-julia.plist | 40 ++--------------------- contrib/Julia_Notepad++.xml | 2 +- contrib/julia.lang | 3 +- contrib/julia.xml | 3 +- doc/manual/calling-c-and-fortran-code.rst | 4 +-- doc/manual/interacting-with-julia.rst | 2 +- doc/manual/interfaces.rst | 2 +- doc/manual/methods.rst | 8 +++-- doc/manual/parallel-computing.rst | 2 +- doc/manual/style-guide.rst | 2 +- doc/manual/types.rst | 2 +- doc/stdlib/base.rst | 2 +- doc/stdlib/math.rst | 6 ---- examples/hpl.jl | 4 +-- src/gen_sysimg_symtab.jl | 10 +++--- src/jltypes.c | 4 +-- test/perf/kernel/go_benchmark.jl | 2 +- 22 files changed, 32 insertions(+), 82 deletions(-) diff --git a/base/deprecated.jl b/base/deprecated.jl index ea09154869c59..59fc56508cb6c 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -884,6 +884,8 @@ function rem1{T<:Real}(x::T, y::T) depwarn("`rem1(x,y)` is discontinued, as it cannot be defined consistently for `x==0`. Rewrite the expression using `mod1` instead.", :rem1) rem(x-1,y)+1 end +rem1(x::Real, y::Real) = rem1(promote(x,y)...) +export rem1 # Filesystem module updates diff --git a/base/docs/helpdb/Base.jl b/base/docs/helpdb/Base.jl index 8e5ff4ad9eb88..8e39b48707623 100644 --- a/base/docs/helpdb/Base.jl +++ b/base/docs/helpdb/Base.jl @@ -3294,7 +3294,7 @@ Redirect I/O to or from the given `command`. Keyword arguments specify which of command's streams should be redirected. `append` controls whether file output appends to the file. This is a more general version of the 2-argument `pipeline` function. `pipeline(from, to)` is equivalent to `pipeline(from, stdout=to)` when `from` is a command, -and to `pipe(to, stdin=from)` when `from` is another kind of data source. +and to `pipeline(to, stdin=from)` when `from` is another kind of data source. **Examples**: @@ -4961,13 +4961,6 @@ The distance between `x` and the next larger representable floating-point value """ eps(::AbstractFloat) -""" - rem1(x, y) - -(Deprecated.) Remainder after division, returning in the range `(0, y]`. -""" -rem1 - """ isalpha(c::Union{Char,AbstractString}) -> Bool diff --git a/base/exports.jl b/base/exports.jl index e3e54124b3494..168f5d0a411ad 100644 --- a/base/exports.jl +++ b/base/exports.jl @@ -422,7 +422,6 @@ export reim, reinterpret, rem, - rem1, round, sec, secd, @@ -1275,7 +1274,6 @@ export isblockdev, ischardev, isdir, - isexecutable, isfifo, isfile, islink, diff --git a/base/promotion.jl b/base/promotion.jl index c52285ede9fc0..304a6a16a3509 100644 --- a/base/promotion.jl +++ b/base/promotion.jl @@ -211,7 +211,6 @@ rem(x::Real, y::Real) = rem(promote(x,y)...) mod(x::Real, y::Real) = mod(promote(x,y)...) mod1(x::Real, y::Real) = mod1(promote(x,y)...) -rem1(x::Real, y::Real) = rem1(promote(x,y)...) fld1(x::Real, y::Real) = fld1(promote(x,y)...) max(x::Real, y::Real) = max(promote(x,y)...) diff --git a/base/strings/types.jl b/base/strings/types.jl index f8184201a4b83..e84e72f738340 100644 --- a/base/strings/types.jl +++ b/base/strings/types.jl @@ -1,6 +1,6 @@ # This file is a part of Julia. License is MIT: http://julialang.org/license -# SubString, RevString, RepString, and RopeString types +# SubString, RevString, and RepString types ## substrings reference original strings ## diff --git a/contrib/BBEditTextWrangler-julia.plist b/contrib/BBEditTextWrangler-julia.plist index 2932dfc963121..fcc862bba363b 100644 --- a/contrib/BBEditTextWrangler-julia.plist +++ b/contrib/BBEditTextWrangler-julia.plist @@ -75,7 +75,6 @@ @ip_str @label @less - @math_const @MIME @MIME_str @noinline @@ -216,7 +215,6 @@ bkfact blas_set_num_threads blkdiag - bool break brfft broadcast! @@ -232,7 +230,6 @@ c_malloc c_realloc call - cartesianmap cat catalan catch @@ -244,7 +241,6 @@ cell cfunction cglobal - char charwidth checkbounds chmod @@ -270,9 +266,6 @@ code_warntype collect colon - complex128 - complex32 - complex64 complex cond condskeel @@ -457,14 +450,7 @@ fldmod flipbits! flipdim - fliplr flipsign - flipud - float16 - float32 - float32_isvalid - float64 - float64_isvalid float floor flush @@ -480,7 +466,6 @@ functionloc gamma gc - gc_disable gc_enable gcd gcdx @@ -554,13 +539,6 @@ init_worker insert! instances - int128 - int16 - int32 - int64 - int8 - int - integer interrupt intersect! intersect @@ -595,7 +573,6 @@ isempty isequal iseven - isexecutable isfifo isfile isfinite @@ -672,7 +649,6 @@ lexless lfact lgamma - linrange linreg linspace listen @@ -739,8 +715,6 @@ mktemp mktempdir mmap - mmap_array - mmap_bitarray mod1 mod2pi mod @@ -795,15 +769,12 @@ parent parentindexes parse - parsefloat - parseint peakflops permute! permutedims! permutedims pi pinv - pipe pipeline plan_bfft! plan_bfft @@ -919,7 +890,6 @@ reinterpret reload relpath - rem1 rem remotecall remotecall_fetch @@ -1046,7 +1016,6 @@ srand start start_reading - start_timer start_watching startswith stat @@ -1054,7 +1023,6 @@ stdm step stop_reading - stop_timer strerror strftime stride @@ -1163,7 +1131,6 @@ whos widemul widen - with_env withenv workers workspace @@ -1201,6 +1168,7 @@ AbstractFloat AbstractMatrix AbstractRNG + AbstractRemoteRef AbstractSparseArray AbstractSparseMatrix AbstractSparseVector @@ -1313,7 +1281,6 @@ FFTW FileMonitor Filter - FloatingPoint FloatRange Function GeneralizedSchur @@ -1405,10 +1372,8 @@ RegexMatch RegexMatchIterator RemoteException - RemoteRef RepString RevString - RopeString RoundDown RoundFromZero RoundingMode @@ -1431,7 +1396,6 @@ SharedArray SharedMatrix SharedVector - SparseMatrix SparseMatrixCSC SpawnNullStream StatStruct @@ -1477,7 +1441,7 @@ UInt UnicodeError UniformScaling - UnionType + Union UnitRange UpperTriangular UTF16String diff --git a/contrib/Julia_Notepad++.xml b/contrib/Julia_Notepad++.xml index fe56575e970ae..dca94a236f320 100644 --- a/contrib/Julia_Notepad++.xml +++ b/contrib/Julia_Notepad++.xml @@ -25,7 +25,7 @@ true false C_NULL Inf NaN Inf32 NaN32 nothing - AbstractArray AbstractMatrix AbstractSparseMatrix AbstractString AbstractVector Any ArgumentError Array Associative AsyncStream BigFloat BigInt BitArray BitMatrix BitVector Bool BunchKaufman 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 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 UVError Union Unsigned VecOrMat Vector VersionNumber Void WeakKeyDict WeakRef Zip + AbstractArray AbstractMatrix AbstractRemoteRef AbstractSparseMatrix AbstractString AbstractVector Any ArgumentError Array Associative AsyncStream BigFloat BigInt BitArray BitMatrix BitVector Bool BunchKaufman 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 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 RepString RevString Reverse 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 UVError Union Unsigned VecOrMat Vector VersionNumber Void WeakKeyDict WeakRef Zip 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 close enumerate error info open print println read write warn print println diff --git a/contrib/julia.lang b/contrib/julia.lang index fcef24b3e5d9e..e7fef8da4b51c 100644 --- a/contrib/julia.lang +++ b/contrib/julia.lang @@ -233,7 +233,7 @@ Any|Void Type(Constructor|Name|Var|_Array)?|(Union|Data|NonTuple)Type (Abstract|Strided|Bit)?(Array|Matrix|Vector) - Abstract(Cmd|RNG|SparseMatrix) + Abstract(Cmd|RNG|RemoteRef|SparseMatrix) (Abstract|Strided)?VecOrMat SparseMatrixCSC (D|Sub((Or)?D)?)Array @@ -308,7 +308,6 @@ RawOrBoxedHandle Redirectable Regex(Match(Iterator)?)? - RemoteRef Rest Reverse (Generalized)?(SVD|Schur) diff --git a/contrib/julia.xml b/contrib/julia.xml index 8ff722197a280..9eae8f34ab56d 100644 --- a/contrib/julia.xml +++ b/contrib/julia.xml @@ -77,6 +77,7 @@ AbstractArray AbstractMatrix + AbstractRemoteRef AbstractSparseMatrix AbstractVector Any @@ -157,11 +158,9 @@ Regex RegexMatch RegexMatchIterator - RemoteRef RepString RevString Reverse - RopeString Schur Set Signed diff --git a/doc/manual/calling-c-and-fortran-code.rst b/doc/manual/calling-c-and-fortran-code.rst index b08264d2868cb..b3d214a7d8164 100644 --- a/doc/manual/calling-c-and-fortran-code.rst +++ b/doc/manual/calling-c-and-fortran-code.rst @@ -817,8 +817,8 @@ Here is a simple example of a C wrapper that returns a ``Ptr`` type:: (Csize_t,), #tuple of input types n #name of Julia variable to pass in ) - if output_ptr==C_NULL #Could not allocate memory - throw(MemoryError()) + if output_ptr==C_NULL # Could not allocate memory + throw(OutOfMemoryError()) end return output_ptr end diff --git a/doc/manual/interacting-with-julia.rst b/doc/manual/interacting-with-julia.rst index bbb60d85f4dce..991042bf1acbd 100644 --- a/doc/manual/interacting-with-julia.rst +++ b/doc/manual/interacting-with-julia.rst @@ -69,7 +69,7 @@ In addition to function names, complete function calls may be entered to see whi help> AbstractString DataType : AbstractString supertype: Any - subtypes : Any[DirectIndexString,RepString,RevString{T<:AbstractString},RopeString,SubString{T<:AbstractString},String] + subtypes : Any[DirectIndexString,RepString,RevString{T<:AbstractString},SubString{T<:AbstractString},String] Help mode can be exited by pressing backspace at the beginning of the line. diff --git a/doc/manual/interfaces.rst b/doc/manual/interfaces.rst index 041cca8842797..a12e1e2ccb3f2 100644 --- a/doc/manual/interfaces.rst +++ b/doc/manual/interfaces.rst @@ -171,7 +171,7 @@ If a type is defined as a subtype of ``AbstractArray``, it inherits a very large A key part in defining an ``AbstractArray`` subtype is :func:`Base.linearindexing`. Since indexing is such an important part of an array and often occurs in hot loops, it's important to make both indexing and indexed assignment as efficient as possible. Array data structures are typically defined in one of two ways: either it most efficiently accesses its elements using just one index (linear indexing) or it intrinsically accesses the elements with indices specified for every dimension. These two modalities are identified by Julia as ``Base.LinearFast()`` and ``Base.LinearSlow()``. Converting a linear index to multiple indexing subscripts is typically very expensive, so this provides a traits-based mechanism to enable efficient generic code for all array types. -This distinction determines which scalar indexing methods the type must define. ``LinearFast()`` arrays are simple: just define :func:`getindex(A::ArrayType, i::Int) `. When the array is subsequently indexed with a multidimensional set of indices, the fallback :func:`getindex(A::AbstractArray, I...)` efficiently converts the indices into one linear index and then calls the above method. ``LinearSlow()`` arrays, on the other hand, require methods to be defined for each supported dimensionality with ``ndims(A)`` ``Int`` indices. For example, the builtin ``SparseMatrix`` type only supports two dimensions, so it just defines :func:`getindex(A::SparseMatrix, i::Int, j::Int)`. The same holds for :func:`setindex!`. +This distinction determines which scalar indexing methods the type must define. ``LinearFast()`` arrays are simple: just define :func:`getindex(A::ArrayType, i::Int) `. When the array is subsequently indexed with a multidimensional set of indices, the fallback :func:`getindex(A::AbstractArray, I...)` efficiently converts the indices into one linear index and then calls the above method. ``LinearSlow()`` arrays, on the other hand, require methods to be defined for each supported dimensionality with ``ndims(A)`` ``Int`` indices. For example, the builtin ``SparseMatrixCSC`` type only supports two dimensions, so it just defines :func:`getindex(A::SparseMatrixCSC, i::Int, j::Int)`. The same holds for :func:`setindex!`. Returning to the sequence of squares from above, we could instead define it as a subtype of an ``AbstractArray{Int, 1}``: diff --git a/doc/manual/methods.rst b/doc/manual/methods.rst index 530d2b48c166d..f70224b1ce9d6 100644 --- a/doc/manual/methods.rst +++ b/doc/manual/methods.rst @@ -225,6 +225,8 @@ Although it seems a simple concept, multiple dispatch on the types of values is perhaps the single most powerful and central feature of the Julia language. Core operations typically have dozens of methods:: +.. doctest:: + julia> methods(+) # 139 methods for generic function "+": +(x::Bool) at bool.jl:33 @@ -320,9 +322,9 @@ Julia language. Core operations typically have dozens of methods:: +(A::Base.LinAlg.SymTridiagonal{T},B::Base.LinAlg.Diagonal{T}) at linalg/special.jl:122 +(A::Base.LinAlg.Bidiagonal{T},B::Base.LinAlg.SymTridiagonal{T}) at linalg/special.jl:121 +(A::Base.LinAlg.SymTridiagonal{T},B::Base.LinAlg.Bidiagonal{T}) at linalg/special.jl:122 - +{Tv1,Ti1,Tv2,Ti2}(A_1::Base.SparseMatrix.SparseMatrixCSC{Tv1,Ti1},A_2::Base.SparseMatrix.SparseMatrixCSC{Tv2,Ti2}) at sparse/sparsematrix.jl:873 - +(A::Base.SparseMatrix.SparseMatrixCSC{Tv,Ti<:Integer},B::Array{T,N}) at sparse/sparsematrix.jl:885 - +(A::Array{T,N},B::Base.SparseMatrix.SparseMatrixCSC{Tv,Ti<:Integer}) at sparse/sparsematrix.jl:887 + +{Tv1,Ti1,Tv2,Ti2}(A_1::Base.SparseArrays.SparseMatrixCSC{Tv1,Ti1},A_2::Base.SparseMatrix.SparseMatrixCSC{Tv2,Ti2}) at sparse/sparsematrix.jl:873 + +(A::Base.SparseArrays.SparseMatrixCSC{Tv,Ti<:Integer},B::Array{T,N}) at sparse/sparsematrix.jl:885 + +(A::Array{T,N},B::Base.SparseArrays.SparseMatrixCSC{Tv,Ti<:Integer}) at sparse/sparsematrix.jl:887 +{P<:Base.Dates.Period}(Y::Union{SubArray{P<:Base.Dates.Period,N,A<:DenseArray{T,N},I<:Tuple{Vararg{Union{Colon,Range{Int64},Int64}}},LD},DenseArray{P<:Base.Dates.Period,N}},x::P<:Base.Dates.Period) at dates/periods.jl:50 +{T<:Base.Dates.TimeType}(r::Range{T<:Base.Dates.TimeType},x::Base.Dates.Period) at dates/ranges.jl:39 +{T<:Number}(x::AbstractArray{T<:Number,N}) at abstractarray.jl:442 diff --git a/doc/manual/parallel-computing.rst b/doc/manual/parallel-computing.rst index 2b539e037c84f..c3f0b09f3d58b 100644 --- a/doc/manual/parallel-computing.rst +++ b/doc/manual/parallel-computing.rst @@ -44,7 +44,7 @@ wait for a remote call to finish by calling :func:`wait` on the returned `Future`, and you can obtain the full value of the result using :func:`fetch`. -On the other hand ``RemoteRefs`` are rewritable. For example, multiple processes +On the other hand ``RemoteChannel`` s are rewritable. For example, multiple processes can co-ordinate their processing by referencing the same remote ``Channel``\ . Let's try this out. Starting with ``julia -p n`` provides ``n`` worker diff --git a/doc/manual/style-guide.rst b/doc/manual/style-guide.rst index a752b37a20ba2..12096cbe9b993 100644 --- a/doc/manual/style-guide.rst +++ b/doc/manual/style-guide.rst @@ -159,7 +159,7 @@ Use naming conventions consistent with Julia's ``base/`` -------------------------------------------------------- - modules and type names use capitalization and camel case: - ``module SparseMatrix``, ``immutable UnitRange``. + ``module SparseArrays``, ``immutable UnitRange``. - functions are lowercase (:func:`maximum`, :func:`convert`) and, when readable, with multiple words squashed together (:func:`isequal`, :func:`haskey`). When necessary, use underscores as word separators. diff --git a/doc/manual/types.rst b/doc/manual/types.rst index 60be47668d213..63fb7a9fb53af 100644 --- a/doc/manual/types.rst +++ b/doc/manual/types.rst @@ -1204,7 +1204,7 @@ As it happens, types are all composite values and thus all have a type of julia> typeof(DataType) DataType - julia> typeof(UnionType) + julia> typeof(Union) DataType :obj:`DataType` is its own type. diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index 686f83311c87f..e4aeea4d14470 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -872,7 +872,7 @@ System .. Docstring generated from Julia source - Redirect I/O to or from the given ``command``\ . Keyword arguments specify which of the command's streams should be redirected. ``append`` controls whether file output appends to the file. This is a more general version of the 2-argument ``pipeline`` function. ``pipeline(from, to)`` is equivalent to ``pipeline(from, stdout=to)`` when ``from`` is a command, and to ``pipe(to, stdin=from)`` when ``from`` is another kind of data source. + Redirect I/O to or from the given ``command``\ . Keyword arguments specify which of the command's streams should be redirected. ``append`` controls whether file output appends to the file. This is a more general version of the 2-argument ``pipeline`` function. ``pipeline(from, to)`` is equivalent to ``pipeline(from, stdout=to)`` when ``from`` is a command, and to ``pipeline(to, stdin=from)`` when ``from`` is another kind of data source. **Examples**: diff --git a/doc/stdlib/math.rst b/doc/stdlib/math.rst index fea8aeb27377d..1c0c38ef3a2fd 100644 --- a/doc/stdlib/math.rst +++ b/doc/stdlib/math.rst @@ -194,12 +194,6 @@ Mathematical Operators Return ``(fld1(x,y), mod1(x,y))``\ . -.. function:: rem1(x, y) - - .. Docstring generated from Julia source - - (Deprecated.) Remainder after division, returning in the range ``(0, y]``\ . - .. _//: .. function:: //(num, den) diff --git a/examples/hpl.jl b/examples/hpl.jl index 1ff09dfbc76eb..9e177637c3c30 100644 --- a/examples/hpl.jl +++ b/examples/hpl.jl @@ -233,7 +233,7 @@ function hpl_par2(A::Matrix, b::Vector) return x end - depend = Array(RemoteRef, nB, nB) + depend = Array(RemoteChannel, nB, nB) #pmap[i] is where block i's stuff is #block i is dist[i] to dist[i+1]-1 @@ -315,7 +315,7 @@ function permute(C, i, j, panel_p, n, flag) end ##permute() function trailing_update_par2(C, L_II, C_KI, i, j, n, flag, dep) - if isa(dep, RemoteRef); wait(dep); end + if isa(dep, RemoteChannel); wait(dep); end if flag #(C.dist[i+1] == n+2) ? (I = (C.dist[i]):n) : # (I = (C.dist[i]):(C.dist[i+1]-1)) diff --git a/src/gen_sysimg_symtab.jl b/src/gen_sysimg_symtab.jl index 50531808ee895..862f8bafb4ab7 100644 --- a/src/gen_sysimg_symtab.jl +++ b/src/gen_sysimg_symtab.jl @@ -9,11 +9,11 @@ fname = ARGS[1] -io,_ = open(pipe(`strings -n 3 $fname`, - `tr -d "() \t+-"`, - `sort`, `uniq -c`, `sort -g -r`, - `grep -v Main`, # for some reason Main breaks things - `head -n 315`)) # 63 + 252 +io,_ = open(pipeline(`strings -n 3 $fname`, + `tr -d "() \t+-"`, + `sort`, `uniq -c`, `sort -g -r`, + `grep -v Main`, # for some reason Main breaks things + `head -n 315`)) # 63 + 252 function outputline(io, line) row = split(chomp(line), " ", keep=false) diff --git a/src/jltypes.c b/src/jltypes.c index 530aa4988d8cd..6147949fa3525 100644 --- a/src/jltypes.c +++ b/src/jltypes.c @@ -1077,7 +1077,7 @@ static jl_value_t *jl_type_intersect(jl_value_t *a, jl_value_t *b, // uses to instantiate its supertype. this tells us what subtype parameter // values are implied by the intersected supertype, or that the // intersected supertype cannot come from this subtype (in which case - // our final answer is Union()). + // our final answer is Union{}). size_t i; // hack: we need type_match to find assignments for all typevars int prev_mim = match_intersection_mode; @@ -1125,7 +1125,7 @@ static jl_value_t *jl_type_intersect(jl_value_t *a, jl_value_t *b, if (jl_svecref(env, e) == tp) { elt = jl_type_intersect(elt, jl_svecref(env, e+1), penv, eqc, invariant); - // note: elt might be Union() if "Union()" was the type parameter + // note: elt might be Union{} if "Union{}" was the type parameter break; } } diff --git a/test/perf/kernel/go_benchmark.jl b/test/perf/kernel/go_benchmark.jl index eeef278fd7ebe..8c8ab39e47489 100644 --- a/test/perf/kernel/go_benchmark.jl +++ b/test/perf/kernel/go_benchmark.jl @@ -478,7 +478,7 @@ end function main(args) n = 10 if length(args) > 0 - n = parseint(args[1]) + n = parse(Int, args[1]) end @time benchmark(n) end