Skip to content

Conversation

nolta
Copy link
Member

@nolta nolta commented Feb 29, 2012

I'm not sure if this is a bug, but currently:

julia> x = cell(2,1)
2x1 Any Array:
access to undefined reference

After this patch:

julia> x = cell(2,2)
2x2 Any Array:
 undef  undef
 undef  undef

julia> x[1,1] = 1.
2x2 Any Array:
  1.0   undef
 undef  undef

@ViralBShah
Copy link
Member

I think it is better to show undef rather than a strange error message that sounds scary. @JeffBezanson and @StefanKarpinski should also take a look. Should we have undef as a type?

@StefanKarpinski
Copy link
Member

Awesome. @ViralBShah: it makes no sense to have an Undef type because the whole point of our undefined value behavior is that no usable value can be undefined. If we had an Undef type, we'd be in the same sort of nasty situation as Java, checking for null all over the place.

StefanKarpinski added a commit that referenced this pull request Feb 29, 2012
better undefined reference handling in show()
@StefanKarpinski StefanKarpinski merged commit 81f6434 into JuliaLang:master Feb 29, 2012
Keno pushed a commit that referenced this pull request Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants