diff --git a/Nimrod-for-C-programmers.md b/Nimrod-for-C-programmers.md index 9fde0b3..7a55f25 100644 --- a/Nimrod-for-C-programmers.md +++ b/Nimrod-for-C-programmers.md @@ -34,7 +34,8 @@ 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 +49,8 @@ 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.