diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-05-24 18:33:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-24 18:33:53 +0200 |
commit | ef8ddef47b6ea10c6e5e504165245ab514391056 (patch) | |
tree | aa1d68dfd81bef608f033af9b25daba96e97e613 /doc | |
parent | d67a9f024eeeb2bc26fb38a98be9a53956003290 (diff) | |
download | Nim-ef8ddef47b6ea10c6e5e504165245ab514391056.tar.gz |
fixes #10912 (#11317)
* fixes #10912 * update the tutorial examples
Diffstat (limited to 'doc')
-rw-r--r-- | doc/tut2.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/tut2.rst b/doc/tut2.rst index fda953eda..44b76f5ac 100644 --- a/doc/tut2.rst +++ b/doc/tut2.rst @@ -277,7 +277,7 @@ Procedures always use static dispatch. For dynamic dispatch replace the a, b: Expression # watch out: 'eval' relies on dynamic binding - method eval(e: Expression): int = + method eval(e: Expression): int {.base.} = # override this base method quit "to override!" @@ -300,7 +300,7 @@ In a multi-method all parameters that have an object type are used for the dispatching: .. code-block:: nim - :test: "nim c $1" + :test: "nim c --multiMethods:on $1" type Thing = ref object of RootObj @@ -611,7 +611,7 @@ To pass a block of statements to a template, use 'untyped' for the last paramete :test: "nim c $1" template withFile(f: untyped, filename: string, mode: FileMode, - body: untyped): typed = + body: untyped) = let fn = filename var f: File if open(f, fn, mode): |