Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "return value" topics to "Thinking in Nu" #1677

Merged
merged 4 commits into from
Dec 16, 2024

Conversation

NotTheDr01ds
Copy link
Contributor

@NotTheDr01ds NotTheDr01ds commented Dec 13, 2024

Another fairly substantial update to the "Thinking in Nu" chapter. It adds two major topics that often confuse new users:

  • Implicit return
  • Only the last value of an expression is returned

Also:

  • Major update to "Think of Nushell as a Compiled Language" and the linked "How Nushell Code Gets Run" chapter

    • There was a lot of duplication between the two chapters. The code-examples that fail parsing in Nushell have now been moved almost exclusively the to the "Thinking in Nu" Chapter and out of "How Nushell Code Gets Run". There are links between the two chapters where needed.
    • This is hopefully much more clear. I certainly understand it better ;-)
    • Previously, the pain point of lacking an eval was much more visible than the benefits. Hopefully the benefits are more clear now.
  • Adds a Table-of-Contents to both chapters

  • Each section closes with a "Thinking in Nushell" callout for consistency. (Side-note: This is listed as a "warning" block, but only for color/style to make it most noticeable).

  • Additional rewrites for clarity and flow

@NotTheDr01ds NotTheDr01ds marked this pull request as draft December 13, 2024 04:09
@NotTheDr01ds NotTheDr01ds marked this pull request as ready for review December 13, 2024 13:06
@NotTheDr01ds NotTheDr01ds marked this pull request as draft December 13, 2024 18:41
@NotTheDr01ds NotTheDr01ds marked this pull request as ready for review December 14, 2024 17:25
@NotTheDr01ds
Copy link
Contributor Author

@kubouch If you get a chance, I'd love your review, but especially the revisions to "Parse-time Evaluation" since this is based on your work in the first place.

Copy link
Contributor

@kubouch kubouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, thanks! I left a few quick comments from my phone, but I didn't find anything that would desperately need fixing, you can address / not address them as you see fit.

book/thinking_in_nu.md Show resolved Hide resolved
book/thinking_in_nu.md Outdated Show resolved Hide resolved
book/thinking_in_nu.md Outdated Show resolved Hide resolved
book/thinking_in_nu.md Show resolved Hide resolved
book/thinking_in_nu.md Show resolved Hide resolved
book/how_nushell_code_gets_run.md Outdated Show resolved Hide resolved
@NotTheDr01ds
Copy link
Contributor Author

@kubouch Thanks! I've just pushed some changes based on your feedback. Greatly appreciated!

@kubouch
Copy link
Contributor

kubouch commented Dec 16, 2024

OK, looks good, it can always be refined in other PRs. We might want to start talking about Nushell as statically compiled instead of just compiled to avoid the confusion with Python bytecode, see my comment above.

@kubouch kubouch merged commit 58df050 into nushell:main Dec 16, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants