Skip to content
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
32 changes: 28 additions & 4 deletions lang-guide/chapters/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,34 @@ Nushell provides support for these bitwise operators:

## Brackets

TODO

### `(` and `)`

### `[` and `]`
The brackets can be used to make [lists](types/basic_types/list.md).
```nu
~> [ 1, 2, 3 ]
╭───┬───╮
│ 0 │ 1 │
│ 1 │ 2 │
│ 2 │ 3 │
╰───┴───╯
```

### `{` and `}`
The braces can be used to make [records](types/basic_types/record.md) and [closures](types/basic_types/closure.md).
```nu
~> { a: 1, b: 2 }
╭───┬───╮
│ a │ 1 │
│ b │ 2 │
╰───┴───╯
```

### `(` and `)`
The parentheses can be used to denote sub-expressions.
```nu
~> # This would fail without parentheses
~> { a: ('aaa' | str length), b: 2 }
╭───┬───╮
│ a │ 3 │
│ b │ 2 │
╰───┴───╯
```