Skip to content

Commit

Permalink
Document switch blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
joningold authored Jul 11, 2018
1 parent 50d4d59 commit 0ed5451
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Documentation/WritingWithInk.md
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ Else conditions can be provided:
- else:
~ y = x + 1
}

### Extended if/else if/else blocks

The above syntax is actually a specific case of a more general structure, something like a "switch" statement of another language:
Expand All @@ -1325,6 +1325,17 @@ And using this form we can include 'else-if' conditions:
}

(Note, as with everything else, the white-space is purely for readability and has no syntactic meaning.)

### Switch blocks

And there's also an actual switch statement:

{ x:
- 0: zero
- 1: one
- 2: two
- else: lots
}

#### Example: context-relevant content

Expand Down

0 comments on commit 0ed5451

Please sign in to comment.