Skip to content

Commit 64deec1

Browse files
committed
Add Hello-world xref
1 parent 3b7a9d5 commit 64deec1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/reference-cpp2.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
# Cpp2 reference
33

4+
### See also: **[Hello, world!](index.md/#hello-world)**
5+
46

57
## Common programming concepts
68

@@ -24,6 +26,7 @@ All Cpp2 declarations are written as **"_name_ `:` _kind_ `=` _statement_"**.
2426
- The `:` is pronounced **"is a."**
2527
- The `=` is pronounced **"defined as."**
2628
- The _statement_ is typically an expression statement (e.g., `a + b();`) or a compound statement (e.g., `{ /*...*/ return c(d) / e; }`).
29+
- Various parts of the syntax allow a `_` "don't care" wildcard or can be omitted entirely to accept a default (e.g., `x: int = 0;` can be equivalently written `x: _ = 0;` or `x := 0;` both of which deduce the type).
2730

2831
For example:
2932

@@ -344,9 +347,9 @@ All parameters and other objects in Cpp2 are `const` by default, except for loca
344347
345348
### Control flow
346349
347-
#### `if` and `else` branches
350+
#### `if`, `else` branches
348351
349-
#### `for`, `while`, and `do` loops
352+
#### `for`, `while`, `do` loops
350353
351354
Loops can be named using the usual **name `:`** name introduction syntax, and `break` and `continue` can refer to those names. For example:
352355

0 commit comments

Comments
 (0)