diff --git a/content/block.md b/content/block.md index b014a4f..b55bfc2 100644 --- a/content/block.md +++ b/content/block.md @@ -21,19 +21,7 @@ block: let b = "3" # Probably a dumb idea ``` -Parentheses can be used as an expression, but they do not provide end of statement inference, so it is necessary to place semicolons yourself. - -``` nimrod -# This doesn't work and I don't know what it should do -square(( - var result = newSeq[float](); - for i in 0..1000: - result[i] = i; - result -)) -``` - -An interesting and unexpected side effect of this syntax is that Nimrod is suitable even for brace purists! +Parentheses can be used as an expression, but they do not provide end of statement inference, so it is necessary to place semicolons yourself. An interesting and unexpected side effect of this syntax is that Nimrod is suitable even for brace purists! ``` nimrod proc square(inSeq: seq[float]): seq[float] = ( @@ -42,4 +30,11 @@ proc square(inSeq: seq[float]): seq[float] = ( result[i] = v*v; ) ) + +square(( # A 1001 long sequence to be squared + var result = newSeq[float](); + for i in 0..1000: + result.add(i); + result +)) ```