summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-07-22 20:20:36 +0200
committerAndreas Rumpf <rumpf_a@web.de>2014-07-22 20:20:36 +0200
commit479b2c629610c7377db788b9de6025d02147df45 (patch)
tree163f3b222733cdf48ca221c1af78a5541dae5ac3 /lib
parent584b6e3d16cc4e3032a92bdead12bb0931b42557 (diff)
parenteafb79b721a0eb461a3097f5a511c1f73994f995 (diff)
downloadNim-479b2c629610c7377db788b9de6025d02147df45.tar.gz
Merge pull request #1381 from gradha/pr_links_echo_variants
Hyperlinks echo variants with noSideEffect pragma. Refs #1379.
Diffstat (limited to 'lib')
-rw-r--r--lib/system.nim16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/system.nim b/lib/system.nim
index 440c6474a..83428344b 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -2026,19 +2026,25 @@ elif hostOS != "standalone":
   {.pop.}
 
 proc echo*[T](x: varargs[T, `$`]) {.magic: "Echo", tags: [FWriteIO], gcsafe.}
-  ## special built-in that takes a variable number of arguments. Each argument
+  ## Writes and flushes the parameters to the standard output.
+  ##
+  ## Special built-in that takes a variable number of arguments. Each argument
   ## is converted to a string via ``$``, so it works for user-defined
   ## types that have an overloaded ``$`` operator.
   ## It is roughly equivalent to ``writeln(stdout, x); flush(stdout)``, but
   ## available for the JavaScript target too.
+  ##
   ## Unlike other IO operations this is guaranteed to be thread-safe as
-  ## ``echo`` is very often used for debugging convenience.
+  ## ``echo`` is very often used for debugging convenience. If you want to use
+  ## ``echo`` inside a `proc without side effects
+  ## <manual.html#nosideeffect-pragma>`_ you can use `debugEcho <#debugEcho>`_
+  ## instead.
 
 proc debugEcho*[T](x: varargs[T, `$`]) {.magic: "Echo", noSideEffect, 
                                          tags: [], raises: [].}
-  ## Same as ``echo``, but as a special semantic rule, ``debugEcho`` pretends
-  ## to be free of side effects, so that it can be used for debugging routines
-  ## marked as ``noSideEffect``.
+  ## Same as `echo <#echo>`_, but as a special semantic rule, ``debugEcho``
+  ## pretends to be free of side effects, so that it can be used for debugging
+  ## routines marked as `noSideEffect <manual.html#nosideeffect-pragma>`_.
 
 template newException*(exceptn: typedesc, message: string): expr =
   ## creates an exception object of type ``exceptn`` and sets its ``msg`` field