mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-09 16:26:53 +02:00
cleanup
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user