Skip to content

Drop examples from closure language reference #1975

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

Closed
wants to merge 1 commit into from

Conversation

Kissaki
Copy link
Contributor

@Kissaki Kissaki commented Jul 12, 2025

Relates to #1929

The language reference should be focused on the language concepts, not describe how various commands make use of it, and especially not in the form of examples.

All these commands have closure examples in the docs comments. All listed commands link to their respective docs.

Dropping the examples increases focus of the reference doc, and reduces risks of doc duplication and of command changes leading to outdated lang ref docs.

@Kissaki Kissaki mentioned this pull request Jul 12, 2025
Relates to nushell#1929

The language reference should be focused on the language concepts, not describe how various commands make use of it, and especially not in the form of examples.

All these commands have closure examples in the docs comments. All listed commands link to their respective docs.

Dropping the examples increases focus of the *reference* doc, and reduces risks of doc duplication and of command changes leading to outdated lang ref docs.
@fdncred
Copy link
Contributor

fdncred commented Jul 16, 2025

I'm not sure I agree. I like examples as a way to help explain things.

@sholderbach
Copy link
Member

I like examples as a way to help explain things.

We are talking about the Language Guide/Reference not the general book. Examples for concepts / distinct specialties of closures yes, stamp collecting of commands that happen to use closures no.

@Kissaki
Copy link
Contributor Author

Kissaki commented Jul 16, 2025

@fdncred Where do you think would be a fitting place for these kinds of or these examples specifically?

Closures are documented in the Book in the Types of data section. But as a relatively concise block. https://www.nushell.sh/book/types_of_data.html#closures


The language reference documents that closures exist.

The fact that they can different forms and parameters is a consequence of what they are. I don't think a list of specific command examples is what should be documented here.

If we want to show that there is variance, beyond just saying that there is, we can do so with two or three examples, with or without specific commands. I would certainly want to evade command headlines as if we were talking about those commands here.


In terms of examples in general, those commands already have closure examples for how they are used in those commands.

@fdncred
Copy link
Contributor

fdncred commented Jul 16, 2025

I'm not suggesting that it be entirely duplicated but having a couple examples and then a "to see more information on closures see some_link" would probably be helpful.

@Kissaki
Copy link
Contributor Author

Kissaki commented Jul 16, 2025

Ok, I'll try to draft something

@Kissaki
Copy link
Contributor Author

Kissaki commented Jul 16, 2025

I created #1982

@Kissaki Kissaki marked this pull request as draft July 16, 2025 17:32
@Kissaki
Copy link
Contributor Author

Kissaki commented Jul 16, 2025

While going through the page I also created #1981

I can see now how the examples can be useful here too. in #1982 I reduced them into something - in my eyes - more appropriate for the lang reference.

@Kissaki Kissaki closed this Jul 16, 2025
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.

3 participants