-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
define isassigned(r::Ref) = isdefined(r, :x)? #18086
Comments
I agree this would be the best, but it might also be reasonable to use |
yuyichao
changed the title
define isdefined(r::Ref) = isdefined(r, :x)?
define isassigned(r::Ref) = isdefined(r, :x)?
Oct 8, 2016
Closed by #18082 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It really seems like we should be able to do
isdefined(r::Ref)
, in analogy withisdefined(a)
for a zero-dimensional array (in both cases, you access the contents with[]
). Right now, you have to doisdefined(r, :x)
, which is annoying because it depends on the internal implementation ofRefValue
.Unfortunately, it's not as simple as
Base.isdefined(r::Ref) = isdefined(r, :x)
becauseisdefined
is a builtin. MaybeCore.isdefined
should be the builtin, andBase.isdefined
should be a generic function that wraps aroundCore.isdefined
?(This came up in JuliaLang/IJulia.jl#447, cc @malmaud)
The text was updated successfully, but these errors were encountered: