mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 14:13:52 +01:00
updated readme
This commit is contained in:
parent
fd32fd2ba7
commit
38d641ffcd
@ -155,7 +155,7 @@ Let's replace the if statement from before with a nice match statement!
|
|||||||
|
|
||||||
the syntax for a match statement is always `match <variable> { <match arms> }`.
|
the syntax for a match statement is always `match <variable> { <match arms> }`.
|
||||||
|
|
||||||
A match arm consists of a condition statement and an action statement. `input.eq("+")`, `input-eq("-")`, and `true` are condition statements.
|
A match arm consists of a condition statement and an action statement. `input.eq("+")`, `input.eq("-")`, and `true` are condition statements.
|
||||||
The match statement will go through all condition statements until one matches (in this case: returns `true`), then run the action statement.
|
The match statement will go through all condition statements until one matches (in this case: returns `true`), then run the action statement.
|
||||||
If we move the `true` match arm to the top, the other two arms will never be executed, even though they might also match.
|
If we move the `true` match arm to the top, the other two arms will never be executed, even though they might also match.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user