Remove result variable
This commit is contained in:
parent
ffafafa239
commit
4abd738f6b
2 changed files with 8 additions and 7 deletions
|
|
@ -7,9 +7,10 @@ Nimrod supports three different types of variables, `let`, `var`, and `const`. A
|
|||
|
||||
``` nimrod
|
||||
proc getAlphabet(): string =
|
||||
result = ""
|
||||
var accm = ""
|
||||
for letter in 'a'..'z':
|
||||
result.add(letter)
|
||||
accm.add(letter)
|
||||
return accm
|
||||
|
||||
# Computed at compilation time
|
||||
const alphabet = getAlphabet()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue