progress on procs

This commit is contained in:
flaviut 2014-06-04 19:56:31 -04:00
commit ab884689d2

View file

@ -2,3 +2,13 @@
title: Procedures
---
# 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
```