浏览代码

SVI Add ch06

SVI 3 月之前
父节点
当前提交
bc0f9326c5
共有 1 个文件被更改,包括 8 次插入 和 7 次删除
  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.