diff --git a/Nimrod-for-C-programmers.md b/Nimrod-for-C-programmers.md index f44b894..8971488 100644 --- a/Nimrod-for-C-programmers.md +++ b/Nimrod-for-C-programmers.md @@ -84,6 +84,36 @@ var x = if foobar(): 42 else: 0 + + + +```C +void foo() { + printf("Hello World\n"); +} +int bar() { + return 2; +} +int baz(int x) { + return x*2; +} +``` + + +```Nimrod +proc foo() = + echo "Hello World" + +proc bar() : int = + 2 + +proc baz(x : int) = + x*2 +``` + +Function/Procedure. + + ```C @@ -106,4 +136,6 @@ proc foobar(a: ref TPerson) = Dereference. In C, only the pointer to the strings in the struct is copied. In Nimrod, the string is also copied, but refs are not deep-copied. + + \ No newline at end of file