diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2014-05-26 00:12:25 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2014-05-26 00:12:25 +0200 |
commit | 97fa3391f2e7e8fefe247117bc2da9a848c4fd15 (patch) | |
tree | 19503d3b5300e8001b18d24cd87474d1ae5d1868 /doc/tut2.txt | |
parent | ab5f2273a6d1ff0bf40306ad9d2e8de3e4748e9e (diff) | |
parent | 489d7e526de7f24996e3d0054a050649cb83bbd9 (diff) | |
download | Nim-97fa3391f2e7e8fefe247117bc2da9a848c4fd15.tar.gz |
Merge pull request #1132 from gradha/pr_index_improvements
Documentation index improvements
Diffstat (limited to 'doc/tut2.txt')
-rw-r--r-- | doc/tut2.txt | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/tut2.txt b/doc/tut2.txt index ea6733c07..11b485f50 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -135,7 +135,7 @@ The ``EInvalidObjectConversion`` exception is raised if ``x`` is not a Object variants --------------- Often an object hierarchy is overkill in certain situations where simple -`variant`:idx: types are needed. +variant types are needed. An example: @@ -182,7 +182,7 @@ bound to a class. This has disadvantages: ``join`` a string method or an array method? Nimrod avoids these problems by not assigning methods to a class. All methods -in Nimrod are `multi-methods`:idx:. As we will see later, multi-methods are +in Nimrod are multi-methods. As we will see later, multi-methods are distinguished from procs only for dynamic binding purposes. @@ -194,7 +194,7 @@ The syntax ``obj.method(args)`` can be used instead of ``method(obj, args)``. If there are no remaining arguments, the parentheses can be omitted: ``obj.len`` (instead of ``len(obj)``). -This `method call syntax`:idx: is not restricted to objects, it can be used +This method call syntax is not restricted to objects, it can be used for any type: .. code-block:: nimrod @@ -343,7 +343,7 @@ evaluation or dead code elimination do not work with methods. Exceptions ========== -In Nimrod `exceptions`:idx: are objects. By convention, exception types are +In Nimrod exceptions are objects. By convention, exception types are prefixed with an 'E', not 'T'. The `system <system.html>`_ module defines an exception hierarchy that you might want to stick to. Exceptions derive from E_Base, which provides the common interface. @@ -380,7 +380,7 @@ the template ``newException`` in the ``system`` module can be used: Try statement ------------- -The `try`:idx: statement handles exceptions: +The ``try`` statement handles exceptions: .. code-block:: nimrod # read the first two lines of a text file that should contain numbers @@ -513,7 +513,7 @@ procs with the list of raised exceptions. You can read more about Nimrod's Generics ======== -`Generics`:idx: are Nimrod's means to parametrize procs, iterators or types +Generics are Nimrod's means to parametrize procs, iterators or types with `type parameters`:idx:. They are most useful for efficient type safe containers: @@ -714,9 +714,9 @@ know how the Nimrod concrete syntax is converted to an abstract syntax tree (AST). The AST is documented in the `macros <macros.html>`_ module. Once your macro is finished, there are two ways to invoke it: -(1) invoking a macro like a procedure call (`expression macros`:idx:) +(1) invoking a macro like a procedure call (expression macros) (2) invoking a macro with the special ``macrostmt`` - syntax (`statement macros`:idx:) + syntax (statement macros) Expression Macros |