Skip to content

Commit

Permalink
Expand enum example tut1.md (#24268)
Browse files Browse the repository at this point in the history
I couldn't understand why there is "x" declaration. Comparison make it
easier to understand to people not familiar to enums.
  • Loading branch information
Ironship authored Oct 13, 2024
1 parent 2f7586c commit 1dbf614
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/tut1.md
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,9 @@ at runtime by 0, the second by 1, and so on. For example:
var x = south # `x` is of type `Direction`; its value is `south`
echo x # prints "south"
if x == Direction.south:
echo "It's south!"
```

All the comparison operators can be used with enumeration types.
Expand Down

0 comments on commit 1dbf614

Please sign in to comment.