diff --git a/book/dataframes.md b/book/dataframes.md index 1962417ba0c..867e6e6b70b 100644 --- a/book/dataframes.md +++ b/book/dataframes.md @@ -1110,7 +1110,7 @@ command categories. | is-duplicated | Series | Creates mask indicating duplicated values | | | is-in | Series | Checks if elements from a series are contained in right series | in | | is-not-null | Series | Creates mask where value is not null | | -| is-null | Series | Creates mask where value is null | ` == $nothing` | +| is-null | Series | Creates mask where value is null | ` == null` | | is-unique | Series | Creates mask indicating unique values | | | join | DataFrame | Joins a dataframe using columns as reference | | | last | DataFrame | Creates new dataframe with last rows | last | diff --git a/book/hooks.md b/book/hooks.md index aa383c82dbe..9ec5e6f9e6f 100644 --- a/book/hooks.md +++ b/book/hooks.md @@ -199,7 +199,7 @@ An example for PWD env change hook: $env.config = ($env.config | upsert hooks.env_change.PWD {|config| let val = ($config | get -i hooks.env_change.PWD) - if $val == $nothing { + if $val == null { $val | append {|before, after| print $"changing directory from ($before) to ($after)" } } else { [ diff --git a/book/types_of_data.md b/book/types_of_data.md index 837f4273a59..f6db177f3fd 100644 --- a/book/types_of_data.md +++ b/book/types_of_data.md @@ -480,7 +480,7 @@ print $x ## Null -Finally, there is `null` (also known as `$nothing`) which is the language's "nothing" value, similar to JSON's "null". Whenever Nushell would print the `null` value (outside of a string or data structure), it prints nothing instead. Hence, most of Nushell's file system commands (like [`save`](/commands/docs/save.md) or [`cd`](/commands/docs/cd.md)) produce `null`. +Finally, there is `null` which is the language's "nothing" value, similar to JSON's "null". Whenever Nushell would print the `null` value (outside of a string or data structure), it prints nothing instead. Hence, most of Nushell's file system commands (like [`save`](/commands/docs/save.md) or [`cd`](/commands/docs/cd.md)) produce `null`. You can place `null` at the end of a pipeline to replace the pipeline's output with it, and thus print nothing: diff --git a/lang-guide/lang-guide.md b/lang-guide/lang-guide.md index 5ce82d6916f..acf07ba8a54 100644 --- a/lang-guide/lang-guide.md +++ b/lang-guide/lang-guide.md @@ -173,7 +173,7 @@ The second syntax is simply a list of records. This plays on the Nushell data mo ### Nothing -The type or value `$nothing` is to be used to represent the absence of another value. Commands that explicitly do not return a value return `$nothing` +The type `nothing` is to be used to represent the absence of another value. Commands that explicitly do not return a value return `null`. Use as a missing value indicator. ### Error @@ -271,7 +271,7 @@ if false { } ``` -The `else` part of `if` is optional. If not provided, if a condition is false, the `if` expression returns `$nothing`. +The `else` part of `if` is optional. If not provided, if a condition is false, the `if` expression returns `null`. The code that follows the `else` is an expression rather than a block, allowing any number of follow-on `if` expressions as well as other types of expressions. For example, this expression returns 100: `if false { 1 } else 100`.