Skip to content

Add missing example output #1984

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

Merged
merged 1 commit into from
Jul 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lang-guide/chapters/types/basic_types/closure.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ Closures are used in Nu extensively as parameters to iteration style commands li
1. You can also use [pipeline input as `$in`](pipelines.html#pipeline-input-and-the-special-in-variable) in most closures instead of providing an explicit parameter. For example:

```nu
1..10 | each { print $in }
1..5 | each { print $in }
# => 1
# => 2
# => 3
# => 4
# => 5
# => ╭────────────╮
# => │ empty list │
# => ╰────────────╯
```

1. You can also pass closures themselves into a pipeline assuming the next command knows how to consume it. For example, the `do` example can be rewritten as:
Expand Down