Skip to content

Commit

Permalink
rename: key => getkey (collections API bikeshedding).
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Feb 10, 2013
1 parent 9c71239 commit 68f63db
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ end
@deprecate cholpd cholpfact
@deprecate qrd qrfact
@deprecate qrpd qrpfact
@deprecate key getkey

export grow!
function grow!(a, d)
Expand Down
6 changes: 3 additions & 3 deletions base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ end

has(h::Dict, key) = (ht_keyindex(h, key) >= 0)

function key{K,V}(h::Dict{K,V}, key, deflt)
function getkey{K,V}(h::Dict{K,V}, key, deflt)
index = ht_keyindex(h, key)
return (index<0) ? deflt : h.keys[index]::K
end
Expand Down Expand Up @@ -510,8 +510,8 @@ WeakKeyDict() = WeakKeyDict{Any,Any}()

assign{K}(wkh::WeakKeyDict{K}, v, key) = add_weak_key(wkh.ht, convert(K,key), v)

function key{K}(wkh::WeakKeyDict{K}, kk, deflt)
k = key(wkh.ht, kk, secret_table_token)
function getkey{K}(wkh::WeakKeyDict{K}, kk, deflt)
k = getkey(wkh.ht, kk, secret_table_token)
if is(k, secret_table_token)
return deflt
end
Expand Down
4 changes: 2 additions & 2 deletions base/error.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ print_with_color(color::Symbol, msg::String...) =

# use colors to print messages and warnings in the REPL

info(msg::String...) = print_with_color(:blue, STDERR, "MESSAGE: ", msg..., "\n")
warn(msg::String...) = print_with_color(:yellow, STDERR, "WARNING: ", msg..., "\n")
info(msg::String...) = print_with_color(:blue, STDERR, "MESSAGE: ", msg..., "\n")
warn(msg::String...) = print_with_color(:red, STDERR, "WARNING: ", msg..., "\n")

This comment has been minimized.

Copy link
@JeffBezanson

JeffBezanson Feb 10, 2013

Member

Did you mean to change the color back to red?

This comment has been minimized.

Copy link
@StefanKarpinski

StefanKarpinski Feb 10, 2013

Author Member

Yeah, the yellow was really not alarming enough and hard to see. I wish there was orange.

2 changes: 1 addition & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ export
intersect,
intersect!,
isempty,
key,
getkey,
keys,
length,
map,
Expand Down
2 changes: 1 addition & 1 deletion base/multi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ type RemoteRef

function RemoteRef(w, wh, id)
r = new(w,wh,id)
found = key(client_refs, r, false)
found = getkey(client_refs, r, false)
if !is(found,false)
return found
end
Expand Down

0 comments on commit 68f63db

Please sign in to comment.