Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JuliaLang/julia into call_overload
Browse files Browse the repository at this point in the history
Conflicts:
	base/deprecated.jl
	base/inference.jl
  • Loading branch information
JeffBezanson committed Oct 10, 2014
2 parents aeae50f + 4dc1679 commit 06471db
Show file tree
Hide file tree
Showing 73 changed files with 621 additions and 513 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ ifeq ($(JULIA_DIST_TARNAME),)
endif

all: default
ifeq ($(JULIA_DEBUG), 1)
default: debug
else
default: release
endif

# sort is used to remove potential duplicates
DIRS = $(sort $(build_bindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/man/man1)
Expand Down
19 changes: 13 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ Library improvements

* `deepcopy` recurses through immutable types and makes copies of their mutable fields ([#8560]).

Deprecated or removed
---------------------

* `median` and `median!` no longer accept a `checknan` keyword argument ([#8605]).

Julia v0.3.0 Release Notes
==========================

Expand Down Expand Up @@ -852,6 +857,7 @@ Too numerous to mention.
[#3688]: https://github.com/JuliaLang/julia/issues/3688
[#3697]: https://github.com/JuliaLang/julia/issues/3697
[#3719]: https://github.com/JuliaLang/julia/issues/3719
[#3759]: https://github.com/JuliaLang/julia/issues/3759
[#3790]: https://github.com/JuliaLang/julia/issues/3790
[#3819]: https://github.com/JuliaLang/julia/issues/3819
[#3872]: https://github.com/JuliaLang/julia/issues/3872
Expand Down Expand Up @@ -913,6 +919,7 @@ Too numerous to mention.
[#5381]: https://github.com/JuliaLang/julia/issues/5381
[#5387]: https://github.com/JuliaLang/julia/issues/5387
[#5403]: https://github.com/JuliaLang/julia/issues/5403
[#5413]: https://github.com/JuliaLang/julia/issues/5413
[#5423]: https://github.com/JuliaLang/julia/issues/5423
[#5427]: https://github.com/JuliaLang/julia/issues/5427
[#5428]: https://github.com/JuliaLang/julia/issues/5428
Expand Down Expand Up @@ -962,6 +969,7 @@ Too numerous to mention.
[#6678]: https://github.com/JuliaLang/julia/issues/6678
[#6716]: https://github.com/JuliaLang/julia/issues/6716
[#6726]: https://github.com/JuliaLang/julia/issues/6726
[#6739]: https://github.com/JuliaLang/julia/issues/6739
[#6769]: https://github.com/JuliaLang/julia/issues/6769
[#6773]: https://github.com/JuliaLang/julia/issues/6773
[#6911]: https://github.com/JuliaLang/julia/issues/6911
Expand All @@ -981,6 +989,7 @@ Too numerous to mention.
[#7146]: https://github.com/JuliaLang/julia/issues/7146
[#7236]: https://github.com/JuliaLang/julia/issues/7236
[#7242]: https://github.com/JuliaLang/julia/issues/7242
[#7311]: https://github.com/JuliaLang/julia/issues/7311
[#7359]: https://github.com/JuliaLang/julia/issues/7359
[#7365]: https://github.com/JuliaLang/julia/issues/7365
[#7373]: https://github.com/JuliaLang/julia/issues/7373
Expand All @@ -990,14 +999,12 @@ Too numerous to mention.
[#7513]: https://github.com/JuliaLang/julia/issues/7513
[#7647]: https://github.com/JuliaLang/julia/issues/7647
[#7654]: https://github.com/JuliaLang/julia/issues/7654
[#7704]: https://github.com/JuliaLang/julia/issues/7704
[#7917]: https://github.com/JuliaLang/julia/issues/7917
[#7992]: https://github.com/JuliaLang/julia/issues/7992
[#8011]: https://github.com/JuliaLang/julia/issues/8011
[#8089]: https://github.com/JuliaLang/julia/issues/8089
[#7704]: https://github.com/JuliaLang/julia/issues/7704
[#5413]: https://github.com/JuliaLang/julia/issues/5413
[#3759]: https://github.com/JuliaLang/julia/issues/3759
[#7311]: https://github.com/JuliaLang/julia/issues/7311
[#8152]: https://github.com/JuliaLang/julia/issues/8152
[#8423]: https://github.com/JuliaLang/julia/issues/8423
[#8152]: https://github.com/JuliaLang/julia/pull/8152
[#6739]: https://github.com/JuliaLang/julia/issues/6739
[#8560]: https://github.com/JuliaLang/julia/issues/8560
[#8605]: https://github.com/JuliaLang/julia/issues/8605
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ First, acquire the source code by cloning the git repository:

Be sure to also configure your system to use the appropriate proxy settings, e.g. by setting the `https_proxy` and `http_proxy` variables.)

Next, enter the `julia/` directory and run `make` to build the `julia` executable. To perform a parallel build, use `make -j N` and supply the maximum number of concurrent processes.
By default you will be building the latest unstable version of Julia. However, most users should use the most recent stable version of Julia, which is currently the `0.3` series of releases. You can get this version by changing to the Julia directory and running

git checkout release-0.3

Now run `make` to build the `julia` executable. To perform a parallel build, use `make -j N` and supply the maximum number of concurrent processes.
When compiled the first time, it will automatically download and build its [external dependencies](#Required-Build-Tools-External-Libraries).
This takes a while, but only has to be done once. If the defaults in the build do not work for you, and you need to set specific make parameters, you can save them in `Make.user`. The build will automatically check for the existence of `Make.user` and use it if it exists.
Building Julia requires 1.5GiB of disk space and approximately 700MiB of virtual memory.
Expand Down
2 changes: 1 addition & 1 deletion base/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ function keymap{D<:Dict}(keymaps::Array{D})
end

const escape_defaults = merge!(
{char(i) => nothing for i=[1:26, 28:31]}, # Ignore control characters by default
AnyDict([char(i) => nothing for i=[1:26, 28:31]]), # Ignore control characters by default
AnyDict( # And ignore other escape sequences by default
"\e*" => nothing,
"\e[*" => nothing,
Expand Down
2 changes: 1 addition & 1 deletion base/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function eval_user_input(ast::ANY, backend::REPLBackend)
ans = backend.ans
# note: value wrapped in a non-syntax value to avoid evaluating
# possibly-invalid syntax (issue #6763).
eval(Main, :(ans = $({ans})[1]))
eval(Main, :(ans = $(Any[ans])[1]))
value = eval(Main, ast)
backend.ans = value
put!(backend.response_channel, (value, nothing))
Expand Down
2 changes: 1 addition & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ end
##
# generic map on any iterator
function map(f::Callable, iters...)
result = {}
result = []
len = length(iters)
states = [start(iters[idx]) for idx in 1:len]
nxtvals = cell(len)
Expand Down
4 changes: 2 additions & 2 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ end

getindex(T::(Type...)) = Array(T,0)

# T[a:b] and T[a:s:b] also contruct typed ranges
# T[a:b] and T[a:s:b] also construct typed ranges
function getindex{T<:Number}(::Type{T}, r::Range)
copy!(Array(T,length(r)), r)
end
Expand Down Expand Up @@ -1148,7 +1148,7 @@ indmin(a) = findmin(a)[2]
# similar to Matlab's ismember
# returns a vector containing the highest index in b for each value in a that is a member of b
function indexin(a::AbstractArray, b::AbstractArray)
bdict = Dict(b, 1:length(b))
bdict = Dict(zip(b, 1:length(b)))
[get(bdict, i, 0) for i in a]
end

Expand Down
2 changes: 1 addition & 1 deletion base/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function length_checked_equal(args...)
n
end

map(f::Callable, a::Array{Any,1}) = { f(a[i]) for i=1:length(a) }
map(f::Callable, a::Array{Any,1}) = Any[ f(a[i]) for i=1:length(a) ]

macro thunk(ex); :(()->$(esc(ex))); end
macro L_str(s); s; end
Expand Down
4 changes: 2 additions & 2 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function repl_hook(input::String)
macroexpand(Expr(:macrocall,symbol("@cmd"),input)))
end

display_error(er) = display_error(er, {})
display_error(er) = display_error(er, [])
function display_error(er, bt)
with_output_color(:red, STDERR) do io
print(io, "ERROR: ")
Expand Down Expand Up @@ -420,7 +420,7 @@ function _start()
ccall(:uv_atexit_hook, Void, ())
end

const atexit_hooks = {}
const atexit_hooks = []

atexit(f::Function) = (unshift!(atexit_hooks, f); nothing)

Expand Down
2 changes: 1 addition & 1 deletion base/combinatorics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ function nextsetpartition(s::AbstractVector, a, b, n, m)
filter!(x->!isempty(x), temp)
end

if isempty(s); return ({s}, ([1], Int[], n, 1)); end
if isempty(s); return ([s], ([1], Int[], n, 1)); end

part = makeparts(s,a,m)

Expand Down
2 changes: 1 addition & 1 deletion base/constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ convert{T<:Integer}(::Type{Rational{T}}, x::MathConst) = convert(Rational{T}, fl
hash(x::MathConst, h::Uint) = hash(object_id(x), h)

-(x::MathConst) = -float64(x)
for op in {:+, :-, :*, :/, :^}
for op in Symbol[:+, :-, :*, :/, :^]
@eval $op(x::MathConst, y::MathConst) = $op(float64(x),float64(y))
end

Expand Down
4 changes: 2 additions & 2 deletions base/darray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function setindex!(a::Array, s::SubDArray, I::UnitRange{Int}...)
offs = [isa(J[i],Int) ? J[i]-1 : first(J[i])-1 for i=1:n]
@sync begin
for i = 1:length(d.chunks)
K_c = {d.indexes[i]...}
K_c = Any[d.indexes[i]...]
K = [ intersect(J[j],K_c[j]) for j=1:n ]
if !any(isempty, K)
idxs = [ I[j][K[j]-offs[j]] for j=1:n ]
Expand Down Expand Up @@ -302,7 +302,7 @@ map(f::Callable, d::DArray) = DArray(I->map(f, localpart(d)), d)

reduce(f::Function, d::DArray) =
mapreduce(fetch, f,
{ @spawnat p reduce(f, localpart(d)) for p in procs(d) })
Any[ @spawnat p reduce(f, localpart(d)) for p in procs(d) ])


function map!(f::Callable, d::DArray)
Expand Down
4 changes: 2 additions & 2 deletions base/dates/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ duplicates(slots) = any(map(x->count(y->x.period==y.period,slots),slots) .> 1)

function DateFormat(f::String,locale::String="english")
slots = Slot[]
trans = {}
trans = []
begtran = match(r"^.*?(?=[ymuUdHMSsEe])",f).match
ss = split(f,r"^.*?(?=[ymuUdHMSsEe])")
s = split(begtran == "" ? ss[1] : ss[2],r"[^ymuUdHMSsEe]+|(?<=([ymuUdHMSsEe])(?!\1))")
Expand Down Expand Up @@ -182,4 +182,4 @@ function format(y::AbstractArray{Date},df::DateFormat=ISODateFormat)
end
function format(y::AbstractArray{DateTime},df::DateFormat=ISODateTimeFormat)
return reshape([Dates.format(y[i],df) for i in 1:length(y)], size(y))
end
end
12 changes: 11 additions & 1 deletion base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ eval(Sys, :(@deprecate shlib_list dllist))
@deprecate put put!
@deprecate take take!

@deprecate Set(a, b...) Set({a, b...})
@deprecate Set(a, b...) Set(Any[a, b...])
# for a bit of backwards compatibility
IntSet(xs::Integer...) = (s=IntSet(); for a in xs; push!(s,a); end; s)
Set{T<:Number}(xs::T...) = Set{T}(xs)
Expand Down Expand Up @@ -191,3 +191,13 @@ function apply(f, args...)
depwarn("apply() is deprecated, use `...` instead", :apply)
return Core._apply(call, f, args...)
end

@deprecate median(v::AbstractArray; checknan::Bool=true) median(v)
@deprecate median(v::AbstractArray, region; checknan::Bool=true) median(v, region)
@deprecate median!(v::AbstractVector; checknan::Bool=true) median!(v)

@deprecate Dict{K,V}(ks::AbstractArray{K}, vs::AbstractArray{V}) Dict{K,V}(zip(ks, vs))
@deprecate Dict{K,V}(ks::(K...), vs::(V...)) Dict{K,V}(zip(ks, vs))
@deprecate Dict{K}(ks::(K...), vs::Tuple) Dict{K,Any}(zip(ks, vs))
@deprecate Dict{V}(ks::Tuple, vs::(V...)) Dict{Any,V}(zip(ks, vs))
@deprecate Dict(ks, vs) Dict{Any,Any}(zip(ks, vs))
18 changes: 11 additions & 7 deletions base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,22 @@ Dict(kv::()) = Dict()
const AnyDict = Dict{Any,Any}

# TODO: this can probably be simplified using `eltype` as a THT (Tim Holy trait)
Dict{K,V}(kv::((K,V)...,)) = Dict{K,V}(kv)
Dict{K }(kv::((K,Any)...,)) = Dict{K,Any}(kv)
Dict{V }(kv::((Any,V)...,)) = Dict{Any,V}(kv)
Dict{K,V}(kv::(Pair{K,V}...,)) = Dict{K,V}(kv)
Dict (kv::(Pair...,)) = Dict{Any,Any}(kv)
Dict{K,V}(kv::((K,V)...,)) = Dict{K,V}(kv)
Dict{K }(kv::((K,Any)...,)) = Dict{K,Any}(kv)
Dict{V }(kv::((Any,V)...,)) = Dict{Any,V}(kv)
Dict{K,V}(kv::(Pair{K,V}...,)) = Dict{K,V}(kv)
Dict{K} (kv::(Pair{K}...,)) = Dict{K,Any}(kv)
Dict{V} (kv::(Pair{TypeVar(:K),V}...,)) = Dict{Any,V}(kv)
Dict (kv::(Pair...,)) = Dict{Any,Any}(kv)

Dict{K,V}(kv::AbstractArray{(K,V)}) = Dict{K,V}(kv)
Dict{K,V}(kv::AbstractArray{Pair{K,V}}) = Dict{K,V}(kv)
Dict{K,V}(kv::Associative{K,V}) = Dict{K,V}(kv)

Dict{K,V}(ps::Pair{K,V}...) = Dict{K,V}(ps)
Dict (ps::Pair...) = Dict{Any,Any}(ps)
Dict{K,V}(ps::Pair{K,V}...) = Dict{K,V}(ps)
Dict{K} (ps::Pair{K}...,) = Dict{K,Any}(ps)
Dict{V} (ps::Pair{TypeVar(:K),V}...,) = Dict{Any,V}(ps)
Dict (ps::Pair...) = Dict{Any,Any}(ps)

Dict(kv) = dict_with_eltype(kv, eltype(kv))
dict_with_eltype{K,V}(kv, ::Type{(K,V)}) = Dict{K,V}(kv)
Expand Down
2 changes: 1 addition & 1 deletion base/expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ _inline(arg) = arg

## some macro utilities ##

find_vars(e) = find_vars(e, {})
find_vars(e) = find_vars(e, [])
function find_vars(e, lst)
if isa(e,Symbol)
if current_module()===Main && isdefined(e)
Expand Down
4 changes: 2 additions & 2 deletions base/hashing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ hx(a::Uint64, b::Float64, h::Uint) = hash_uint64((3a + reinterpret(Uint64,b)) -
const hx_NaN = hx(uint64(0), NaN, uint(0 ))

hash(x::Uint64, h::Uint) = hx(x, float64(x), h)
hash(x::Int64, h::Uint) = hx(reinterpret(Uint64,x), float64(x), h)
hash(x::Float64, h::Uint) = isnan(x) ? (hx_NaN $ h) : hx(box(Uint64,fptosi(unbox(Float64,x))), x, h)
hash(x::Int64, h::Uint) = hx(reinterpret(Uint64,abs(x)), float64(x), h)
hash(x::Float64, h::Uint) = isnan(x) ? (hx_NaN $ h) : hx(box(Uint64,fptoui(unbox(Float64,abs(x)))), x, h)

hash(x::Union(Bool,Char,Int8,Uint8,Int16,Uint16,Int32,Uint32), h::Uint) = hash(int64(x), h)
hash(x::Float32, h::Uint) = hash(float64(x), h)
Expand Down
6 changes: 3 additions & 3 deletions base/help.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ function init_help()
mfunc = func
end
if !haskey(FUNCTION_DICT, mfunc)
FUNCTION_DICT[mfunc] = {}
FUNCTION_DICT[mfunc] = []
end
push!(FUNCTION_DICT[mfunc], desc)
if !haskey(MODULE_DICT, func)
MODULE_DICT[func] = {}
MODULE_DICT[func] = []
end
if !in(mod, MODULE_DICT[func])
push!(MODULE_DICT[func], mod)
Expand Down Expand Up @@ -94,7 +94,7 @@ function help(io::IO, fname::String, obj=0)
found = true
elseif haskey(MODULE_DICT, fname)
allmods = MODULE_DICT[fname]
alldesc = {}
alldesc = []
for mod in allmods
mfname = isempty(mod) ? fname : mod * "." * fname
if isgeneric(obj)
Expand Down
Loading

0 comments on commit 06471db

Please sign in to comment.