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.
Based on a discussion in the Website/Doc Discord channel yesterday. This is an extensive refactor of the monolithic Language Guide into smaller, individual files that can be more easily edited and merged.
This has the added advantage of properly styling headings in the sub-files.
During this refactor, I did make a few other tweaks along the way:
The existing file had highly inconsistent heading levels, resulting in some topics appearing as subheadings of other topics they aren't. Fixed all heading levels to be consistent across all files.
Changed
dataframe
example for Custom Value to Polars PluginAdded a deprecation notice to
lazy make
Added some additional conversion/casting to/from
path
Added a conversion example for
range->list
(i.e.,1..5 | each {||}
)Tweaked wording on the headings for data types that can't be "used by scripts" and can't be used to declare variables.
Fixed minor typos (e.g., "A syntactic. form used by some Nushell keywords.")
When explaining the return value of a block, described
if
/else
/try
as expressions rather than statements (this terminology was used elsewhere in the doc as well).Renamed "Numbers and Arithmetic" to "Operators" to more accurately reflect its contents
Added intro/overview for "Flow Control", mainly to note that "Filters" should be considered as an alternative in many cases.
Moved filters like
each
from "Flow Control" to a new section on Filters. Added new (since the guide was initially written) flow control statements likeloop
,break
,continue
,while
, etc.Moved "Brackets" to "Operators" - I don't have a strong opinion on this and can move it to its own file if needed, it just seems better grouped here.
Ommited "Nu as a shell" for now. These topics are probably best covered in "The Book" rather than the language guide, but since they were empty placeholders anyway, we can add them back in when/if created.
Removed the "Literals" section as the only literal discussed was String, which has its own section. Additional literal forms are defined in the "Types" section, so this looks to be potentially redundant.
I can back out any of these if there's disagreement - They just felt fairly safe and needed while I was creating the sub-files.