Jelajahi Sumber

SVI Add ch06

SVI 2 bulan lalu
induk
melakukan
bc0f9326c5
1 mengubah file dengan 8 tambahan dan 7 penghapusan
  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.