From 11c671aafc3e59699d83fdc540c30fb85de33ca7 Mon Sep 17 00:00:00 2001 From: flaviut Date: Tue, 21 Oct 2014 16:14:09 -0700 Subject: [PATCH] Updated Common Criticisms (markdown) --- Common-Criticisms.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Common-Criticisms.md b/Common-Criticisms.md index ecff558..3975230 100644 --- a/Common-Criticisms.md +++ b/Common-Criticisms.md @@ -3,8 +3,10 @@ Possibly. The problem here is that of perception. In many languages, heap alloca ``` nimrod proc foo(input: ref T) = ... -let a: ref T +let a: ref T = ... foo(a) # valid, this is Java-style -var b: T +var b: T = ... foo(b) # also valid and equivalent -``` \ No newline at end of file +``` + +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. \ No newline at end of file