diff options
author | rumpf_a@web.de <> | 2009-10-21 10:20:15 +0200 |
---|---|---|
committer | rumpf_a@web.de <> | 2009-10-21 10:20:15 +0200 |
commit | 053309e60aee1eda594a4817ac8ac2fb8c18fb04 (patch) | |
tree | 0f1ce8b0de0b493045eb97eeca6ebf06542de601 /doc/tut2.txt | |
parent | 581572b28c65bc9fe47974cfd625210a69be0f3f (diff) | |
download | Nim-053309e60aee1eda594a4817ac8ac2fb8c18fb04.tar.gz |
version 0.8.2
Diffstat (limited to 'doc/tut2.txt')
-rwxr-xr-x | doc/tut2.txt | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/doc/tut2.txt b/doc/tut2.txt index 4515ffbd5..c81f98e77 100755 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -177,8 +177,7 @@ bound to a class. This has disadvantages: * Adding a method to a class the programmer has no control over is impossible or needs ugly workarounds. * Often it is unclear where the method should belong to: Is - ``join`` a string method or an array method? Should the complex - ``vertexCover`` algorithm really be a method of the ``graph`` class? + ``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 @@ -206,7 +205,7 @@ for any type: (Another way to look at the method call syntax is that it provides the missing postfix notation.) -So code that looks "pure object oriented" is easy to write: +So "pure object oriented" code is easy to write: .. code-block:: nimrod import strutils @@ -277,7 +276,7 @@ already provides ``v[]`` access. Dynamic dispatch ---------------- -Procedures always use static dispatch. To get dynamic dispatch, replace the +Procedures always use static dispatch. For dynamic dispatch replace the ``proc`` keyword by ``method``: .. code-block:: nimrod |