summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-07-22 17:20:33 +0200
committerAndreas Rumpf <rumpf_a@web.de>2017-07-22 17:20:33 +0200
commit44bd4d87743db6a9b2059d16307315e037d02522 (patch)
treec9b41c5ebce50041df34ac6c7d3c81ab783503f5
parent4e3bdcc84b5c703bb484e32da9c8419699019a0c (diff)
downloadNim-44bd4d87743db6a9b2059d16307315e037d02522.tar.gz
fixes #6125
-rw-r--r--doc/tut1.rst9
-rw-r--r--doc/tut2.rst6
2 files changed, 5 insertions, 10 deletions
diff --git a/doc/tut1.rst b/doc/tut1.rst
index fc8e411cb..89893a39a 100644
--- a/doc/tut1.rst
+++ b/doc/tut1.rst
@@ -138,7 +138,7 @@ comments can also be nested.
     ]#
   ]#
 
-You can also use the `discard statement`_ together with *long string
+You can also use the `discard statement <#procedures-discard-statement>`_ together with *long string
 literals* to create block comments:
 
 .. code-block:: nim
@@ -364,8 +364,7 @@ iterator:
     echo i
   # --> Outputs 1 2 3 4 5 6 7 8 9 10 on different lines
 
-The built-in `$ <system.html#$>`_ operator turns an integer (``int``) and many
-other types into a string. The variable ``i`` is implicitly declared by the
+The variable ``i`` is implicitly declared by the
 ``for`` loop and has the type ``int``, because that is what `countup
 <system.html#countup>`_ returns. ``i`` runs through the values 1, 2, .., 10.
 Each value is ``echo``-ed. This code does the same:
@@ -501,10 +500,6 @@ differences:
 The ``when`` statement is useful for writing platform specific code, similar to
 the ``#ifdef`` construct in the C programming language.
 
-**Note**: To comment out a large piece of code, it is often better to use a
-``when false:`` statement than to use real comments. This way nesting is
-possible.
-
 
 Statements and indentation
 ==========================
diff --git a/doc/tut2.rst b/doc/tut2.rst
index f145528a1..763dd9b01 100644
--- a/doc/tut2.rst
+++ b/doc/tut2.rst
@@ -233,15 +233,15 @@ is needed:
 
   type
     Socket* = ref object of RootObj
-      host: int # cannot be accessed from the outside of the module due to missing star
+      h: int # cannot be accessed from the outside of the module due to missing star
 
   proc `host=`*(s: var Socket, value: int) {.inline.} =
     ## setter of host address
-    s.host = value
+    s.h = value
 
   proc host*(s: Socket): int {.inline.} =
     ## getter of host address
-    s.host
+    s.h
 
   var s: Socket
   new s