Updated Common Criticisms (markdown)

This commit is contained in:
flaviut 2014-10-21 16:46:56 -07:00
parent 11456d75e3
commit b272a94d42
1 changed files with 3 additions and 1 deletions

View File

@ -1,4 +1,6 @@
## Callsite annotations on var parameters would decrease mistakes
## Nim doesn't require call-site annotation for `var` parameters
This is referring to systems like C#'s: `void foo(ref int myInput){...}; foo(ref a);`. Note the ref on the `foo` call. If this was Nim, it'd be impossible to tell from the call-site that `foo` has the potential to modify `a`.
Possibly. The problem here is that of perception. In many languages, heap allocation through pointers is the only method of having objects, and passing them to a function gives the freedom to modify them. In Nim, things can be allocated on the stack, and those things need to be treated in the same way as things on the heap.
``` nimrod