Updated Common Criticisms (markdown)
This commit is contained in:
parent
1ed836880c
commit
11c671aafc
|
@ -3,8 +3,10 @@ Possibly. The problem here is that of perception. In many languages, heap alloca
|
||||||
|
|
||||||
``` nimrod
|
``` nimrod
|
||||||
proc foo(input: ref T) = ...
|
proc foo(input: ref T) = ...
|
||||||
let a: ref T
|
let a: ref T = ...
|
||||||
foo(a) # valid, this is Java-style
|
foo(a) # valid, this is Java-style
|
||||||
var b: T
|
var b: T = ...
|
||||||
foo(b) # also valid and equivalent
|
foo(b) # also valid and equivalent
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note that the difference between what happens in Java and what Nim does is simply a matter of efficiency: Nim does not require our `T` to be allocated on the heap.
|
Loading…
Reference in New Issue