revert to nested lists
This commit is contained in:
parent
4e0d445f3a
commit
fb97a53b49
2 changed files with 8 additions and 8 deletions
|
|
@ -6,9 +6,9 @@ title: Procedures
|
|||
Procedures in Nimrod are declared using `proc` and require that their parameter and return types be annotated. After the types and parameters, an `=` is used to denote the start of the function body.
|
||||
|
||||
``` nimrod
|
||||
proc fibonacci(a, b, n: int): int =
|
||||
if n > 1:
|
||||
result = fibonacci(b, a+b, n - 1)
|
||||
else
|
||||
a
|
||||
proc fibonacci(n: int): int =
|
||||
if n < 2:
|
||||
result = n
|
||||
else:
|
||||
result = fibonacci(n - 1) + fibonacci(n - 2)
|
||||
```
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
* [Getting Started](/getting_started/)
|
||||
* [Hello World](/hello_world/)
|
||||
* [Variables](/variables/page/)
|
||||
* [Result](/variables/result/)
|
||||
* [Type Casting and Inference](/variables/type_casting_inference/)
|
||||
* [Result](/variables/result/)
|
||||
* [Type Casting and Inference](/variables/type_casting_inference/)
|
||||
* [Objects](/objects/)
|
||||
* [Enums](/enums/)
|
||||
* [If, Else, While, Block](/if_else_while/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue