diff options
author | Araq <rumpf_a@web.de> | 2011-09-24 20:22:53 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-09-24 20:22:53 +0200 |
commit | 0f37d0e1f2aeee466b3c6179886963354eaa6222 (patch) | |
tree | 51ae4183dabd454877d7570cafb7f72dcf519011 /doc | |
parent | 485c371942cbbb1f9a10c64b6fcc699e59511460 (diff) | |
download | Nim-0f37d0e1f2aeee466b3c6179886963354eaa6222.tar.gz |
sockets.recv optimizations; stdlib now supports taint mode
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/manual.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/doc/manual.txt b/doc/manual.txt index 6b73c0960..03e763190 100755 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -3402,3 +3402,25 @@ The interaction between threads and exceptions is simple: A *handled* exception in one thread cannot affect any other thread. However, an *unhandled* exception in one thread terminates the whole *process*! +Taint mode +========== + +The Nimrod compiler and standard library support a `taint mode`:idx:. +Input strings are declared with the `TaintedString`:idx: string type declared +in the ``system`` module. + +If the taint mode is turned on (via the ``--taintMode:on`` command line +option) it is a distinct string type which helps to detect input +validation errors: + +.. code-block:: nimrod + echo "your name: " + var name: TaintedString = stdin.readline + # it is safe here to output the name without any input validation, so + # we simply convert `name` to string to make the compiler happy: + echo "hi, ", name.string + +If the taint mode is turned off, ``TaintedString`` is simply an alias for +``string``. + + |