Minor case correction
This commit is contained in:
parent
99e6ea7884
commit
dd26b9b27b
1 changed files with 3 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ Nimrod also supports case statements, which are like switches in other languages
|
|||
* You can use strings in the switch statement
|
||||
* Sets and ranges of ordinal types are also usable
|
||||
* case statements, like most things, are actually expressions
|
||||
* It is required that every possible case be covered
|
||||
|
||||
``` Nimrod
|
||||
case "charlie"
|
||||
|
|
@ -33,6 +34,8 @@ proc positiveOrNegative(num: int): string =
|
|||
"zero"
|
||||
of 1..high(int):
|
||||
"positive"
|
||||
else:
|
||||
"impossible"
|
||||
|
||||
echo positiveOrNegative(-1)
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue