From 3565b10410ef5d7a60722e99337561b9f84f56c1 Mon Sep 17 00:00:00 2001 From: Audun Wilhelmsen Date: Thu, 26 Dec 2013 15:20:35 -0800 Subject: [PATCH] Updated Nimrod for C programmers (markdown) --- Nimrod-for-C-programmers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Nimrod-for-C-programmers.md b/Nimrod-for-C-programmers.md index bddb2f4..9fde0b3 100644 --- a/Nimrod-for-C-programmers.md +++ b/Nimrod-for-C-programmers.md @@ -34,7 +34,7 @@ The other important thing to know is that while C uses a separate language to do In C an array is more or less syntactic sugar for pointers. In Nimrod, arrays are much more strict and safe to use. They are pass-by-value (meaning they're copied at assignment). When passing an array to a proc in Nimrod, the argument is a read-only reference, meaning it can't be assigned to. Take the following example: **C:** -```C +```c void foobar(int z[4]) { z[5] = 5; printf("%d\n",z[5]); @@ -48,7 +48,7 @@ int main() { ``` **Nimrod:** -```Nimrod +```nimrod proc foobar(z: array[0..3, int]) = z[5] = 5 # Error: Cannot assign to z echo z[5] # Error: Index out of bounds.