Browse Source

SVI Add ch06

SVI 1 month ago
parent
commit
bc0f9326c5
1 changed files with 8 additions and 7 deletions
  1. 8 7
      doc/part01/ch06.md

+ 8 - 7
doc/part01/ch06.md

@@ -1,11 +1,12 @@
-# Chapter 6. Let vs Var
+# Глава 6. let и var
 
 A variable can not only be introduced via var but also via let:
+
+```nim
  let points = @[Point(x: 2, y: 4)]
  resetPointsToOrigin points
-Such a let variable cannot be changed after its initialization so
-resetPointsToOrigin points is rejected too.
-As programs grow larger, the enforced discipline about what can be mutated
-helps both compilers and human programmers to reason about the code. At
-the same time, the rules are not overly restrictive and don’t prevent the
-development of classical or novel algorithms.
+```
+
+Such a let variable cannot be changed after its initialization so resetPointsToOrigin points is rejected too.
+
+As programs grow larger, the enforced discipline about what can be mutated helps both compilers and human programmers to reason about the code. At the same time, the rules are not overly restrictive and don’t prevent the development of classical or novel algorithms.