Fix minor typos and clarify Parsing and evaluation...
section
#329
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.
I found two minor typos in the beginning of the book.
Also, I wanted to try to clarify the
Parsing and evaluation...
section ofThinking in Nu
because I think this is by far the most confusing section for people coming to Nu. I know there have been discussions of how to clarify it on Discord, but I figured I'd submit some minor changes as a first effort.Personally, I think that the given example is more confusing than is necessary. This is especially true because if you run each line as a separate command in the shell, it will work perfectly - and this is how most people will think to try the script.
Instead, I would highlight the second example and use that to explain the overall concept. It's much more clear (to me, at least) that sourcing a dynamic path doesn't work because the source command tries to parse the contents of the path before the dynamic expression has been evaluated. We could, for example, give this self-contained example:
This has the added benefit that it would fail even if run from the shell, unlike the current primary example. Also, I think this is a familiar command to people coming from other shells, because sourcing the [
.bashrc/.zshrc/...
] is the normal way to reload the configuration values. I think that isn't best practice in Nushell, but this section is just about explaining the concepts, not instructing in the proper use of Nu.