Skip to content

Commit 0c62780

Browse files
committed
update lang-guide
1 parent bc25693 commit 0c62780

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

lang-guide/chapters/strings_and_text.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ Sometimes you need to nest quotes. I think this could use some work because some
118118
The key to always remember is that double quotes recognize and interpret escapes so if you have any `\` characters in your string, they will be interpreted as escapes. The following is an example of a question we get frequently on Discord.
119119

120120
```nu
121-
Why doesn't this work?
122-
> cd "C:\Program Files\somedir"
121+
# => Why doesn't this work?
122+
cd "C:\Program Files\somedir"
123123
```
124124

125125
It doesn't work because it sees `\P` and `\s` as escapes that are not recognized.

lang-guide/chapters/types/basic_types/table.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
Table literals can be created using a syntax similar to that of a list literal. Because tables also contain columns and not just values, we also specify the column names:
1818

1919
```nu
20-
> [[column1, column2]; [Value1, Value2] [Value3, Value4]]
21-
╭───┬─────────┬─────────╮
22-
│ # │ column1 │ column2 │
23-
├───┼─────────┼─────────┤
24-
│ 0 │ Value1 │ Value2 │
25-
│ 1 │ Value3 │ Value4 │
26-
╰───┴─────────┴─────────╯
20+
[[column1, column2]; [Value1, Value2] [Value3, Value4]]
21+
# => ╭───┬─────────┬─────────╮
22+
# => │ # │ column1 │ column2 │
23+
# => ├───┼─────────┼─────────┤
24+
# => │ 0 │ Value1 │ Value2 │
25+
# => │ 1 │ Value3 │ Value4 │
26+
# => ╰───┴─────────┴─────────╯
2727
```
2828

2929
In this syntax, the headers are separated from the data cells using a semicolon(`;`). The semicolon separator is mandatory in a table-literal. It must follow the headers.
@@ -33,13 +33,13 @@ In this syntax, the headers are separated from the data cells using a semicolon(
3333
You can also create a table as a list of records, JSON-style:
3434

3535
```nu
36-
> [{name: "Sam", rank: 10}, {name: "Bob", rank: 7}]
37-
╭───┬──────┬──────╮
38-
│ # │ name │ rank │
39-
├───┼──────┼──────┤
40-
│ 0 │ Sam │ 10 │
41-
│ 1 │ Bob │ 7 │
42-
╰───┴──────┴──────╯
36+
[{name: "Sam", rank: 10}, {name: "Bob", rank: 7}]
37+
# => ╭───┬──────┬──────╮
38+
# => │ # │ name │ rank │
39+
# => ├───┼──────┼──────┤
40+
# => │ 0 │ Sam │ 10 │
41+
# => │ 1 │ Bob │ 7 │
42+
# => ╰───┴──────┴──────╯
4343
```
4444

4545
This list-of-records pattern plays on the Nushell data model, which sees a list of records as equivalent to a table. This is useful in cases where the length of a table may not be known ahead of time. In such a case, a stream of records likewise represents a table.

0 commit comments

Comments
 (0)