Update block.md
This commit is contained in:
parent
4277b18e76
commit
fcec1ae159
1 changed files with 5 additions and 2 deletions
|
|
@ -21,7 +21,9 @@ block:
|
||||||
let b = "3" # shadowing is probably a dumb idea
|
let b = "3" # shadowing is 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. An interesting and unexpected side effect of this syntax is that Nim 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 Nim is suitable even for die-hard brace purists!
|
||||||
|
|
||||||
|
While possible, it doesn't mean it's a good idea. Most Nim code does not use parentheses in that way, and it would not be seen as idiomatic.
|
||||||
|
|
||||||
``` nimrod
|
``` nimrod
|
||||||
proc square(inSeq: seq[float]): seq[float] = (
|
proc square(inSeq: seq[float]): seq[float] = (
|
||||||
|
|
@ -32,6 +34,7 @@ proc square(inSeq: seq[float]): seq[float] = (
|
||||||
)
|
)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<!-- XXX FIX
|
<!-- XXX FIX
|
||||||
square(( # A 1001 long sequence to be squared
|
square(( # A 1001 long sequence to be squared
|
||||||
var result = newSeq[float]();
|
var result = newSeq[float]();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue