Nothing type

Hi, Julia deals with Nothing type in such way that an object initialized with nothing does/returns nothing, in other words, the Assignment operator = can deal with Nothing type. That feature and the Nothing type evaluation isnothing() are useful to develop algorithm. In order to fully take advantage of Nothing type could you consider extended Nothing type to other operators? For examples:
1/ a = 1 + nothing should return 1
2/ a=nothing
a[:,:] or view() should do nothing

Best.

You are likely looking for missing, not nothing. This is also explained in the manual:

https://docs.julialang.org/en/v1/manual/faq/#faq-nothing

Note however, that missing is not accepted by all function and is mostly intended for use in numerical contexts. Missings.jl does have passmissing though, which you might find interesting.

3 Likes

Ty for your help!