summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorXtreak <tirkarthi@users.noreply.github.com>2015-11-23 18:02:55 +0530
committerXtreak <tirkarthi@users.noreply.github.com>2015-11-23 18:02:55 +0530
commit6bebd2ebcffc54d9364ef4c7f6240b462ef8f751 (patch)
tree4465c02b1874780af1f5b9ff5175fb9d07f254e7
parent989cdd45ed1b733798073ea75d3bce1cee47c57b (diff)
parente3724925d2d96eb2f19f9f53ba77f4acba33f7b7 (diff)
downloadNim-6bebd2ebcffc54d9364ef4c7f6240b462ef8f751.tar.gz
Merge pull request #1 from tirkarthi/tirkarthi-patch-1
Wrap the example in a code block
-rw-r--r--doc/tut1.txt23
1 files changed, 11 insertions, 12 deletions
diff --git a/doc/tut1.txt b/doc/tut1.txt
index 7dce8a218..747c1a3ff 100644
--- a/doc/tut1.txt
+++ b/doc/tut1.txt
@@ -758,19 +758,18 @@ However, this cannot be done for mutually recursive procedures:
   # forward declaration:
   proc even(n: int): bool
 
-proc even(n: int): bool
-
-proc odd(n: int): bool =
-  assert(n >= 0) # makes sure we don't run into negative recursion
-  if n == 0: false
-  else:
-    n == 1 or even(n-1)
+.. code-block:: nim
+  proc odd(n: int): bool =
+    assert(n >= 0) # makes sure we don't run into negative recursion
+    if n == 0: false
+    else:
+      n == 1 or even(n-1)
 
-proc even(n: int): bool =
-  assert(n >= 0) # makes sure we don't run into negative recursion
-  if n == 1: false
-  else:
-    n == 0 or odd(n-1)
+  proc even(n: int): bool =
+    assert(n >= 0) # makes sure we don't run into negative recursion
+    if n == 1: false
+    else:
+      n == 0 or odd(n-1)
 
 Here ``odd`` depends on ``even`` and vice versa. Thus ``even`` needs to be
 introduced to the compiler before it is completely defined. The syntax for