1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-09 16:26:53 +02:00
This commit is contained in:
JasonJAyalaP
2014-09-19 20:17:59 -05:00
parent b87f1acc21
commit 64cd3c4e22

View File

@@ -12,14 +12,14 @@ efficiency.
Nim is efficient, expressive, and elegant. Nim is efficient, expressive, and elegant.
```nimrod ```nimrod
var # Declare and assign several variables, var # Declare (and assign) variables,
letter: char = 'n' # with or without type annotations letter: char = 'n' # with or without type annotations
lang = "N" & "im" lang = "N" & "im"
n_let : int = len(lang) n_let : int = len(lang)
boat: float boat: float
truth: bool = false truth: bool = false
let # Use let to declare and bind an variable *once*. let # Use let to declare and bind variables *once*.
legs = 400 # legs is immutable. legs = 400 # legs is immutable.
arms = 2_000 # _ are ignored and are useful for long numbers. arms = 2_000 # _ are ignored and are useful for long numbers.
aboutPi = 3.15 aboutPi = 3.15