Revise "Result"
This commit is contained in:
parent
dd592ebc92
commit
1b7e23333e
1 changed files with 1 additions and 1 deletions
|
|
@ -3,7 +3,7 @@ title: Result
|
|||
---
|
||||
# Result
|
||||
|
||||
The `result` variable is a special variable that serves as an implicit return variable. This is useful because in most cases, the control flow semantics of the `return` statement are unneeded. `result` is initialized with the default value for a given return type, so the following code starts as `0`, before being initialized to `number`:
|
||||
The `result` variable is a special variable that serves as an implicit return variable, which exists because the control flow semantics of the `return` statement are rarely needed. The result variable is initialized in the standard way, as if it was declared with `var result: T`.
|
||||
|
||||
``` nimrod
|
||||
proc `**`(number, power: int): int =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue