function keys(D::DictChannel)
keys(D.d)
end
as well s add the function name in the import (I tried also without adding the "keys") :
import Base: put!, wait, isready, take!, fetch, keys
to the file, I then include("dictchannel.jl").
All functions e.g. put!() and fetch() work as should but for my new function I get:
LoadError: MethodError: `keys` has no method matching keys(::RemoteRef{DictChannel})
Not sure what I am doing wrong so any help appreciated
https://github.com/JuliaLang/julia/blob/master/examples/dictchannel.jl
function keys(D::RemoteRef{DictChannel})
keys(D.d)
end
Gives also error:
LoadError: type RemoteRef has no field d
Also, for the function put! That does work the function looks like:
function put!(D::DictChannel, k, v)
D.d[k] = v
notify(D.cond_take)
D
end
It just makes no sense to me way keys(D.d) Should not work in the same way.
function put!(D::DictChannel, k, v)
D.d[k] = v
notify(D.cond_take)
Println(keys(D.d))
D
end
And run this I get
Any[2,3,1]
(I added keps in that order), i.e. This works
So it seemed the function definition of keys does not work in the same way as for put! For some reason and I can't figure out why