From ab884689d2c3060705422a6cfa8d9ab39adc0d2e Mon Sep 17 00:00:00 2001 From: flaviut Date: Wed, 4 Jun 2014 19:56:31 -0400 Subject: [PATCH] progress on procs --- content/procs.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/content/procs.md b/content/procs.md index 176f481..0604ccd 100644 --- a/content/procs.md +++ b/content/procs.md @@ -1,4 +1,14 @@ --- title: Procedures --- -# Procedures \ No newline at end of file +# 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 +``` \ No newline at end of file