`Nothing` is a type inhabited by one value, which is spelled `nothing`. The type `None` is inhabited by no values. In other words, you can't even have a value of type `None` to dispatch on. This is why it is eliminated when you take the type union--all values in `Union(Int64, None)` are actually still `Int64`, since the set of values of `None` is the empty set.
On Saturday, May 24, 2014 1:06:10 PM UTC-5, Steve Kelly wrote: > > I've done some quick experiments with None and Nothing, and I am > seeing nearly identical performance and memory allocation. It seems > 'Nothing' is more idiomatic Julia considering the role it plays in > function return. > > Another insight I would like to add is the role it plays in type > unions. In the REPL you see > > julia> Union(Int64, None) > Int64 > > julia> Union(Int64, Nothing) > Union(Nothing,Int64) > > I am wondering if this is the primary reason Nothing is preferred over > None. > > Best, > Steve > > On Sat, May 24, 2014 at 11:58 AM, Dom Luna <[email protected]> wrote: > > Thanks for all the helpful messages everyone, much appreciated:) >
