Undefined values: Difference between revisions

Line 607:
Julia has two different notions of undefined values:
 
1. During compilation, a variable name that is not recognized by the compiler causes an undefined variable error. For example, if the variable x has not been defined previously and is used on the right-hand side of an expression, this produces in the REPL cammandcommand line:
<code>
julia> x + 1
ERROR: UndefVarError: x not defined
Stacktrace:
[1] top-level scope at none:0
</code>
<br />
2. For variables that are defined for the Julia program but have undefined values, there are two different notions of undefined value in Julia (version > 0.7): <code> nothing </code> and <code> missing </code>. "nothing" and "missing" are constants used by convention to refer to either (with <code> nothing </code> an absent result, such as a search with nothing found, or in the case of <code> missing </code> a data table containing missing values.
 
4,102

edits