use only null as the value and the type for "nothing"#9918
Closed
amtoine wants to merge 18 commits intonushell:mainfrom
Closed
use only null as the value and the type for "nothing"#9918amtoine wants to merge 18 commits intonushell:mainfrom
null as the value and the type for "nothing"#9918amtoine wants to merge 18 commits intonushell:mainfrom
Conversation
commands used
```nushell
sd "nothing" "null" **/*.rs
sd "nothing" "null" **/*.nu
```
replacements manually left because it's just english sentences using the
word "nothing":
- src/terminal.rs: // Common case, nothing to do
- crates/nu-engine/src/env.rs: None => { /* not preset, do nothing */ }
- crates/nu-glob/LICENSE-APACHE: Notwithstanding the above, nothing herein shall supersede or modify
- crates/nu-glob/src/lib.rs: /// match the input string and nothing else.
- crates/nu-glob/src/lib.rs: // not a directory, nothing more to find
- crates/nu-system/src/foreground.rs:/// It does nothing special on windows system, `spawn` is the same as [std::process::Command::spawn](std::process::Command::spawn)
- crates/nu-table/src/types/expanded.rs: // We consider showing something better then nothing,
- crates/nu-protocol/src/engine/stack.rs: // nothing has been hidden in this overlay
- crates/nu-protocol/src/engine/stack.rs: // nothing has been hidden in this overlay
command used ```nushell sd "Value::Nothing" "Value::Null" **/*.rs ```
command used ```nushell sd "Type::Nothing" "Type::Null" **/*.rs ```
the rest are ony comments and the LICENSE.
commands used ```nushell sd --string-mode "$nothing" "null" **/*.rs sd --string-mode "$nothing" "null" **/*.nu sd --string-mode "$null" "null" **/*.rs sd --string-mode "$null" "null" **/*.nu ``` format
Member
Author
|
and it was fun to play a bit with the language 😉 |
Member
Author
|
closing in favor of #9973 which only renames the type |
24 tasks
amtoine
added a commit
that referenced
this pull request
Sep 26, 2023
related to - #9973 - #9918 thanks to @jntrnr and their super useful tips on this PR, i learned about the parser + evaluation, so 🙏 # Description because we already have `null` as the value of the type `nothing` and as a followup to the two other attempts of mine, i propose to remove the redundant `$nothing` built-in variable 😋 this PR is the first step, deprecating `$nothing`. a followup PR will remove it altogether and wait for 0.87 👍 ⚙️ **details**: a new `NOTHING_VARIABLE_ID = 3` has been added, parsing `$nothing` will create it, finally a `Value::Nothing` will be produced and a warning will be reported. this PR already fixes the `toolkit.nu` module so that it does not throw a bunch of warnings each time 👌 # User-Facing Changes `$nothing` is now deprecated and will be removed in 0.87 ```nushell > $nothing Error: × Deprecated variable ╭─[entry #1:1:1] 1 │ $nothing · ────┬─── · ╰── `$nothing` is deprecated and will be removed in 0.87. ╰──── help: Use `null` instead ``` # Tests + Formatting tests have been updated, especially - `nothing_fails_string` - `nothing_fails_int` which use a variable called `nil` now to make sure `nothing` does not support cell paths 👍 # After Submitting classic deprecation mention 👍
hardfau1t
pushed a commit
to hardfau1t/nushell
that referenced
this pull request
Dec 14, 2023
related to - nushell#9973 - nushell#9918 thanks to @jntrnr and their super useful tips on this PR, i learned about the parser + evaluation, so 🙏 # Description because we already have `null` as the value of the type `nothing` and as a followup to the two other attempts of mine, i propose to remove the redundant `$nothing` built-in variable 😋 this PR is the first step, deprecating `$nothing`. a followup PR will remove it altogether and wait for 0.87 👍 ⚙️ **details**: a new `NOTHING_VARIABLE_ID = 3` has been added, parsing `$nothing` will create it, finally a `Value::Nothing` will be produced and a warning will be reported. this PR already fixes the `toolkit.nu` module so that it does not throw a bunch of warnings each time 👌 # User-Facing Changes `$nothing` is now deprecated and will be removed in 0.87 ```nushell > $nothing Error: × Deprecated variable ╭─[entry #1:1:1] 1 │ $nothing · ────┬─── · ╰── `$nothing` is deprecated and will be removed in 0.87. ╰──── help: Use `null` instead ``` # Tests + Formatting tests have been updated, especially - `nothing_fails_string` - `nothing_fails_int` which use a variable called `nil` now to make sure `nothing` does not support cell paths 👍 # After Submitting classic deprecation mention 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
in the Discord server, there has been a discussion about
nulland$nothingbeing confusing.
i thought i would give this a try 😏
This PR
nothingtype intonull$nothingvariable, leaving onlynullas before👍👍 pros:
nulland$nothingdoing the same thingnullas the type andnullas the value👎👎 cons:
"null"as the key in$env.config.color_configbecauseconclusion
i think removing
$nothingis the important thing in this PR.i think it makes the language simpler by removing this redundant variable as we
already have
null😋the renaming of
nothingtype intonullcan be discussed and, i think, revertedif we decide to keep (1)
nullas the value and (2)nothingas the type 😉User-Facing Changes
nothingtype becomesnull$nothingvariable is removed andnullas a value should be usedTests + Formatting
toolkit fmttoolkit clippytoolkit testtoolkit test stdlibAfter Submitting
mention in the release notes!!