On Thu, Oct 9, 2014 at 8:50 AM, Ivar Nesje <[email protected]> wrote:

> How can I return #undef from a function?
>
>

You will have to modify the internals of Julia so that *#undef* becomes a
> value that can be passed around. Currently it isn't, but we have a new
> concept in 0.4-dev with nullable types
> <http://docs.julialang.org/en/latest/manual/nullable-types/> that might
> suit your need.
>

Please don't try to actually do this – the fact that #undef is not a
first-class value is very much by design. Tony Hoare has given entire talks
<http://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare>
about
why including null references as first class values in Algol was a "billion
dollar mistake", which was of course, then copied by C, Java, etc. This
should perhaps go in our FAQ.

Reply via email to