Updated Nimrod for C programmers (markdown)

This commit is contained in:
Audun Wilhelmsen 2013-12-20 02:16:18 -08:00
parent f2c74b90e3
commit a805bedc8a
1 changed files with 32 additions and 0 deletions

View File

@ -84,6 +84,36 @@ var x = if foobar(): 42 else: 0
</td>
</tr>
<tr>
<td>
```C
void foo() {
printf("Hello World\n");
}
int bar() {
return 2;
}
int baz(int x) {
return x*2;
}
```
</td>
<td>
```Nimrod
proc foo() =
echo "Hello World"
proc bar() : int =
2
proc baz(x : int) =
x*2
```
</td>
<td><b>Function/Procedure.</b> </td>
</tr>
<tr>
<td>
```C
@ -106,4 +136,6 @@ proc foobar(a: ref TPerson) =
</td>
<td><b>Dereference.</b> <i>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.</i> </td>
</tr>
</table>