Permalink
Browse files

rename: HashTable => Dict, IdTable => ObjectIdDict [closes #766].

  • Loading branch information...
StefanKarpinski committed Apr 26, 2012
1 parent ccfc195 commit 9296f4f65d6985f1a6bcd865fc140bb95d5150ec
Showing with 181 additions and 179 deletions.
  1. +6 −6 base/array.jl
  2. +1 −1 base/client.jl
  3. +10 −10 base/inference.jl
  4. +2 −2 base/intfuncs.jl
  5. +6 −6 base/multi.jl
  6. +2 −2 base/process.jl
  7. +3 −3 base/serialize.jl
  8. +3 −3 base/set.jl
  9. +14 −14 base/sysimg.jl
  10. +56 −54 base/table.jl
  11. +2 −2 base/task.jl
  12. +2 −2 base/util.jl
  13. +5 −5 examples/wordcount.jl
  14. +8 −8 extras/bitarray.jl
  15. +4 −4 extras/cairo.jl
  16. +1 −1 extras/dicom.jl
  17. +3 −3 extras/inifile.jl
  18. +4 −4 extras/lru.jl
  19. +3 −3 extras/options.jl
  20. +1 −1 extras/plot.jl
  21. +2 −2 extras/trie.jl
  22. +38 −38 extras/winston.jl
  23. +3 −3 src/dump.c
  24. +2 −2 test/corelib.jl
View
@@ -203,7 +203,7 @@ function ref(A::Array, I::Indices...)
X = similar(A, d[1:i])
if is(ref_cache,nothing)
- ref_cache = HashTable()
+ ref_cache = Dict()
end
gen_cartesian_map(ref_cache, ivars -> quote
X[storeind] = A[$(ivars...)]
@@ -358,7 +358,7 @@ let assign_cache = nothing
global assign
function assign(A::Array, x, I0::Indices, I::Indices...)
if is(assign_cache,nothing)
- assign_cache = HashTable()
+ assign_cache = Dict()
end
gen_cartesian_map(assign_cache, ivars->:(A[$(ivars...)] = x),
tuple(I0, I...),
@@ -372,7 +372,7 @@ let assign_cache = nothing
global assign
function assign(A::Array, X::AbstractArray, I0::Indices, I::Indices...)
if is(assign_cache,nothing)
- assign_cache = HashTable()
+ assign_cache = Dict()
end
gen_cartesian_map(assign_cache, ivars->:(A[$(ivars...)] = X[refind];
refind += 1),
@@ -926,7 +926,7 @@ function findn{T}(A::StridedArray{T})
ranges = ntuple(ndims(A), d->(1:size(A,d)))
if is(findn_cache,nothing)
- findn_cache = HashTable()
+ findn_cache = Dict()
end
gen_cartesian_map(findn_cache, findn_one, ranges,
@@ -1023,7 +1023,7 @@ function areduce(f::Function, A::StridedArray, region::Region, v0, RType::Type)
R = similar(A, RType, dimsR)
if is(areduce_cache,nothing)
- areduce_cache = HashTable()
+ areduce_cache = Dict()
end
key = ndimsA
@@ -1345,7 +1345,7 @@ function permute(A::StridedArray, perm)
end
if is(permute_cache,nothing)
- permute_cache = HashTable()
+ permute_cache = Dict()
end
gen_cartesian_map(permute_cache, permute_one, ranges,
View
@@ -187,7 +187,7 @@ function _start()
ccall(:jl_register_toplevel_eh, Void, ())
ccall(:jl_start_io_thread, Void, ())
global const Workqueue = WorkItem[]
- global const Waiting = HashTable(64)
+ global const Waiting = Dict(64)
if !anyp(a->(a=="--worker"), ARGS)
# start in "head node" mode
View
@@ -60,7 +60,7 @@ isType(t::ANY) = isa(t,AbstractKind) && is((t::AbstractKind).name,Type.name)
isseqtype(t::ANY) = isa(t,AbstractKind) && is((t::AbstractKind).name.name,:...)
-const t_func = IdTable()
+const t_func = ObjectIdDict()
#t_func[tuple] = (0, Inf, (args...)->limit_tuple_depth(args))
t_func[throw] = (1, 1, x->None)
t_func[boxsi8] = (1, 1, x->Int8)
@@ -318,7 +318,7 @@ function builtin_tfunction(f::ANY, args::ANY, argtypes::ANY)
if is(f,tuple)
return limit_tuple_depth(argtypes)
end
- tf = get(t_func::IdTable, f, false)
+ tf = get(t_func::ObjectIdDict, f, false)
if is(tf,false)
# struct constructor
if isa(f, CompositeKind)
@@ -342,7 +342,7 @@ end
type StaticVarInfo
sp::Tuple
- cenv::IdTable # types of closed vars
+ cenv::ObjectIdDict # types of closed vars
end
function a2t(a::AbstractVector)
@@ -679,7 +679,7 @@ abstract_eval(s::SymbolNode, vtypes, sv::StaticVarInfo) =
abstract_eval(x, vtypes, sv::StaticVarInfo) = abstract_eval_constant(x)
-typealias VarTable IdTable
+typealias VarTable ObjectIdDict
type StateUpdate
var::Symbol
@@ -778,12 +778,12 @@ end
function stupdate(state, changes::Union(StateUpdate,VarTable), vars)
if is(state,())
- state = IdTable()
+ state = ObjectIdDict()
end
for i = 1:length(vars)
v = vars[i]
newtype = changes[v]
- oldtype = get(state::IdTable,v,NF)
+ oldtype = get(state::ObjectIdDict,v,NF)
if tchanged(newtype, oldtype)
state[v] = tmerge(oldtype, newtype)
end
@@ -931,7 +931,7 @@ function typeinf(linfo::LambdaStaticData,atypes::Tuple,sparams::Tuple, def, cop)
# initial set of pc
add(W,1)
# initial types
- s[1] = IdTable()
+ s[1] = ObjectIdDict()
for v in vars
s[1][v] = Undef
end
@@ -949,7 +949,7 @@ function typeinf(linfo::LambdaStaticData,atypes::Tuple,sparams::Tuple, def, cop)
s[1][args[i]] = atypes[i]
end
# types of closed vars
- cenv = IdTable()
+ cenv = ObjectIdDict()
for vi = ((ast.args[2][3])::Array{Any,1})
vi::Array{Any,1}
vname = vi[1]
@@ -1108,7 +1108,7 @@ function typeinf(linfo::LambdaStaticData,atypes::Tuple,sparams::Tuple, def, cop)
end
function record_var_type(e::Symbol, t, decls)
- otherTy = get(decls::IdTable, e, false)
+ otherTy = get(decls::ObjectIdDict, e, false)
# keep track of whether a variable is always the same type
if !is(otherTy,false)
if !is(otherTy, t)
@@ -1175,7 +1175,7 @@ end
# annotate types of all symbols in AST
function type_annotate(ast::Expr, states::Array{Any,1},
sv::ANY, rettype::ANY, vnames::ANY)
- decls = IdTable()
+ decls = ObjectIdDict()
closures = LambdaStaticData[]
body = ast.args[3].args::Array{Any,1}
for i=1:length(body)
View
@@ -276,7 +276,7 @@ bits(x::Union(Int64,Uint64,Float64)) = bin(reinterpret(Uint64,x), 64)
# TODO: maybe implement a proper Eratosthenes's sieve.
-function factor{T<:Integer}(n::T, h::HashTable{T,Int})
+function factor{T<:Integer}(n::T, h::Dict{T,Int})
if n <= 0
error("factor: number to be factored must be positive")
end
@@ -298,4 +298,4 @@ function factor{T<:Integer}(n::T, h::HashTable{T,Int})
h[n] = get(h,n,0)+1
return h
end
-factor{T<:Integer}(n::T) = factor(n, HashTable{T,Int}())
+factor{T<:Integer}(n::T) = factor(n, Dict{T,Int}())
View
@@ -179,10 +179,10 @@ type ProcessGroup
np::Int
# global references
- refs::HashTable
+ refs::Dict
function ProcessGroup(myid::Integer, w::Array{Any,1}, locs::Array{Any,1})
- return new(myid, w, locs, length(w), HashTable())
+ return new(myid, w, locs, length(w), Dict())
end
end
@@ -192,7 +192,7 @@ function add_workers(PGRP::ProcessGroup, w::Array{Any,1})
# NOTE: currently only node 1 can add new nodes, since nobody else
# has the full list of address:port
newlocs = append(PGRP.locs, locs)
- sockets = HashTable()
+ sockets = Dict()
handler = fd->message_handler(fd, sockets)
for i=1:n
push(PGRP.workers, w[i])
@@ -269,7 +269,7 @@ end
## remote refs and core messages: do, call, fetch, wait, ref, put ##
-const _jl_client_refs = WeakKeyHashTable()
+const _jl_client_refs = WeakKeyDict()
type RemoteRef
where::Int
@@ -958,7 +958,7 @@ function start_worker(wrfd)
global const Scheduler = current_task()
- worker_sockets = HashTable()
+ worker_sockets = Dict()
add_fd_handler(sockfd, fd->accept_handler(fd, worker_sockets))
try
@@ -1554,7 +1554,7 @@ end
yield() = yieldto(Scheduler)
-const _jl_fd_handlers = HashTable()
+const _jl_fd_handlers = Dict()
add_fd_handler(fd::Int32, H) = (_jl_fd_handlers[fd]=H)
del_fd_handler(fd::Int32) = del(_jl_fd_handlers, fd)
View
@@ -160,7 +160,7 @@ end
type Cmd
exec::Executable
- pipes::HashTable{FileDes,PipeEnd}
+ pipes::Dict{FileDes,PipeEnd}
pipeline::Set{Cmd}
pid::Int32
status::ProcessStatus
@@ -171,7 +171,7 @@ type Cmd
error("Cmd: too few words to exec")
end
this = new(exec,
- HashTable{FileDes,PipeEnd}(),
+ Dict{FileDes,PipeEnd}(),
Set{Cmd}(),
0,
ProcessNotRun(),
View
@@ -5,8 +5,8 @@ abstract LongSymbol
abstract LongTuple
abstract LongExpr
-const _jl_ser_tag = IdTable()
-const _jl_deser_tag = IdTable()
+const _jl_ser_tag = ObjectIdDict()
+const _jl_deser_tag = ObjectIdDict()
let i = 2
global _jl_ser_tag, _jl_deser_tag
for t = {Symbol, Int8, Uint8, Int16, Uint16, Int32, Uint32,
@@ -238,7 +238,7 @@ deserialize_tuple(s, len) = (a = ntuple(len, i->deserialize(s));
deserialize(s, ::Type{Symbol}) = symbol(read(s, Uint8, int32(read(s, Uint8))))
deserialize(s, ::Type{LongSymbol}) = symbol(read(s, Uint8, read(s, Int32)))
-const _jl_known_lambda_data = HashTable()
+const _jl_known_lambda_data = Dict()
function deserialize(s, ::Type{Function})
b = read(s, Uint8)
View
@@ -1,8 +1,8 @@
type Set{T}
- hash::HashTable{T,Bool}
+ hash::Dict{T,Bool}
- Set() = new(HashTable{T,Bool}())
- Set(x...) = add_each(new(HashTable{T,Bool}(length(x))), x)
+ Set() = new(Dict{T,Bool}())
+ Set(x...) = add_each(new(Dict{T,Bool}(length(x))), x)
end
Set() = Set{Any}()
Set(x...) = Set{Any}(x...)
View
@@ -98,13 +98,13 @@ include("signal_fftw.jl")
# prime method cache with some things we know we'll need right after startup
length(1:2:3)
-(HashTable(0)[1])=()->()
+(Dict(0)[1])=()->()
numel(intset())
has(intset(),2)
del_all(FDSet())
-start(HashTable(0))
-done(HashTable(0),0)
-get(HashTable(0), 0, ())
+start(Dict(0))
+done(Dict(0),0)
+get(Dict(0), 0, ())
add(FDSet(),int32(0))
2==2.0
2.0==2.0
@@ -116,25 +116,25 @@ compile_hint(getcwd, ())
compile_hint(fdio, (Int32,))
compile_hint(ProcessGroup, (Int, Array{Any,1}, Array{Any,1}))
compile_hint(select_read, (FDSet, Float64))
-compile_hint(next, (HashTable{Any,Any}, Int))
-compile_hint(start, (HashTable{Any,Any},))
+compile_hint(next, (Dict{Any,Any}, Int))
+compile_hint(start, (Dict{Any,Any},))
compile_hint(perform_work, ())
compile_hint(isempty, (Array{Any,1},))
compile_hint(isempty, (Array{WorkItem,1},))
-compile_hint(ref, (HashTable{Any,Any}, Int32))
+compile_hint(ref, (Dict{Any,Any}, Int32))
compile_hint(event_loop, (Bool,))
compile_hint(_start, ())
compile_hint(process_options, (Array{Any,1},))
compile_hint(run_repl, ())
compile_hint(anyp, (Function, Array{Any,1}))
-compile_hint(HashTable, (Int,))
-compile_hint(HashTable{Any,Any}, (Int,))
+compile_hint(Dict, (Int,))
+compile_hint(Dict{Any,Any}, (Int,))
compile_hint(Set, ())
-compile_hint(assign, (HashTable{Any,Any}, Bool, Cmd))
-compile_hint(rehash, (HashTable{Any,Any}, Int))
+compile_hint(assign, (Dict{Any,Any}, Bool, Cmd))
+compile_hint(rehash, (Dict{Any,Any}, Int))
compile_hint(run, (Cmd,))
compile_hint(spawn, (Cmd,))
-compile_hint(assign, (HashTable{Any,Any}, Bool, FileDes))
+compile_hint(assign, (Dict{Any,Any}, Bool, FileDes))
compile_hint(wait, (Int32,))
compile_hint(system_error, (ASCIIString, Bool))
compile_hint(SystemError, (ASCIIString,))
@@ -150,7 +150,7 @@ compile_hint(open, (ASCIIString, Bool, Bool, Bool, Bool))
compile_hint(srand, (Uint64,))
compile_hint(done, (IntSet, Int64))
compile_hint(next, (IntSet, Int64))
-compile_hint(ht_keyindex, (HashTable{Any,Any}, Int32))
+compile_hint(ht_keyindex, (Dict{Any,Any}, Int32))
compile_hint(perform_work, (WorkItem,))
compile_hint(notify_done, (WorkItem,))
compile_hint(work_result, (WorkItem,))
@@ -197,7 +197,7 @@ compile_hint(_ieval, (Symbol,))
compile_hint(static_convert, (Any, Any))
compile_hint(assign, (Array{Any,1}, WeakRef, Int))
compile_hint(hash, (Tuple,))
-compile_hint(assign, (HashTable{Any,Any}, WorkItem, (Int,Int)))
+compile_hint(assign, (Dict{Any,Any}, WorkItem, (Int,Int)))
compile_hint(isequal, ((Int,Int),(Int,Int)))
compile_hint(RemoteRef, (Int, Int, Int))
compile_hint(inlining_pass, (LambdaStaticData, Array{Any,1}))
Oops, something went wrong.

0 comments on commit 9296f4f

Please sign in to comment.