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