diff options
author | patrick dw <algorithicimperative@gmail.com> | 2015-06-19 01:08:41 -0500 |
---|---|---|
committer | patrick dw <algorithicimperative@gmail.com> | 2015-06-19 01:08:41 -0500 |
commit | b6252af5c6ce99c6eaec91fb5570143151660b74 (patch) | |
tree | bc64997b315593679d1303a99d9ae632d7dce546 | |
parent | 15e7fe787a2bf89b82aeba965ed4fd8b200dca1a (diff) | |
download | Nim-b6252af5c6ce99c6eaec91fb5570143151660b74.tar.gz |
rename writeln to writeLine in doc
-rw-r--r-- | doc/astspec.txt | 4 | ||||
-rw-r--r-- | doc/manual/generics.txt | 2 | ||||
-rw-r--r-- | doc/manual/procs.txt | 2 | ||||
-rw-r--r-- | doc/manual/templates.txt | 30 | ||||
-rw-r--r-- | doc/manual/trmacros.txt | 2 | ||||
-rw-r--r-- | doc/tut2.txt | 26 |
6 files changed, 33 insertions, 33 deletions
diff --git a/doc/astspec.txt b/doc/astspec.txt index d3ca7755e..9bedb00fc 100644 --- a/doc/astspec.txt +++ b/doc/astspec.txt @@ -222,13 +222,13 @@ Call with named arguments Concrete syntax: .. code-block:: nim - writeln(file=stdout, "hallo") + writeLine(file=stdout, "hallo") AST: .. code-block:: nim nnkCall( - nnkIdent(!"writeln"), + nnkIdent(!"writeLine"), nnkExprEqExpr( nnkIdent(!"file"), nnkIdent(!"stdout") diff --git a/doc/manual/generics.txt b/doc/manual/generics.txt index f82cad531..839e005a1 100644 --- a/doc/manual/generics.txt +++ b/doc/manual/generics.txt @@ -53,7 +53,7 @@ The following example shows a generic binary tree can be modelled: add(root, newNode("hallo")) # instantiates generic procs ``newNode`` and add(root, newNode("world")) # ``add`` for str in inorder(root): - writeln(stdout, str) + writeLine(stdout, str) Is operator diff --git a/doc/manual/procs.txt b/doc/manual/procs.txt index 23b5e4d1e..df633072d 100644 --- a/doc/manual/procs.txt +++ b/doc/manual/procs.txt @@ -132,7 +132,7 @@ to supply any type of first argument for procedures: echo("abc".len) # is the same as echo(len("abc")) echo("abc".toUpper()) echo({'a', 'b', 'c'}.card) - stdout.writeln("Hallo") # the same as writeln(stdout, "Hallo") + stdout.writeLine("Hallo") # the same as writeLine(stdout, "Hallo") Another way to look at the method call syntax is that it provides the missing postfix notation. diff --git a/doc/manual/templates.txt b/doc/manual/templates.txt index eeb907ce0..950d2fab7 100644 --- a/doc/manual/templates.txt +++ b/doc/manual/templates.txt @@ -77,10 +77,10 @@ special ``:`` syntax: quit("cannot open: " & fn) withFile(txt, "ttempl3.txt", fmWrite): - txt.writeln("line 1") - txt.writeln("line 2") + txt.writeLine("line 1") + txt.writeLine("line 2") -In the example the two ``writeln`` statements are bound to the ``actions`` +In the example the two ``writeLine`` statements are bound to the ``actions`` parameter. @@ -206,8 +206,8 @@ template parameter, it is an inject'ed symbol: ... withFile(txt, "ttempl3.txt", fmWrite): - txt.writeln("line 1") - txt.writeln("line 2") + txt.writeLine("line 1") + txt.writeLine("line 2") The ``inject`` and ``gensym`` pragmas are second class annotations; they have @@ -299,7 +299,7 @@ variable number of arguments: # add a call to the statement list that writes ": " add(result, newCall("write", newIdentNode("stdout"), newStrLitNode(": "))) # add a call to the statement list that writes the expressions value: - add(result, newCall("writeln", newIdentNode("stdout"), n[i])) + add(result, newCall("writeLine", newIdentNode("stdout"), n[i])) var a: array [0..10, int] @@ -314,15 +314,15 @@ The macro call expands to: .. code-block:: nim write(stdout, "a[0]") write(stdout, ": ") - writeln(stdout, a[0]) + writeLine(stdout, a[0]) write(stdout, "a[1]") write(stdout, ": ") - writeln(stdout, a[1]) + writeLine(stdout, a[1]) write(stdout, "x") write(stdout, ": ") - writeln(stdout, x) + writeLine(stdout, x) Arguments that are passed to a ``varargs`` parameter are wrapped in an array @@ -333,7 +333,7 @@ children. BindSym ------- -The above ``debug`` macro relies on the fact that ``write``, ``writeln`` and +The above ``debug`` macro relies on the fact that ``write``, ``writeLine`` and ``stdout`` are declared in the system module and thus visible in the instantiating context. There is a way to use bound identifiers (aka `symbols`:idx:) instead of using unbound identifiers. The ``bindSym`` @@ -348,7 +348,7 @@ builtin can be used for that: # we can bind symbols in scope via 'bindSym': add(result, newCall(bindSym"write", bindSym"stdout", toStrLit(n[i]))) add(result, newCall(bindSym"write", bindSym"stdout", newStrLitNode(": "))) - add(result, newCall(bindSym"writeln", bindSym"stdout", n[i])) + add(result, newCall(bindSym"writeLine", bindSym"stdout", n[i])) var a: array [0..10, int] @@ -363,17 +363,17 @@ The macro call expands to: .. code-block:: nim write(stdout, "a[0]") write(stdout, ": ") - writeln(stdout, a[0]) + writeLine(stdout, a[0]) write(stdout, "a[1]") write(stdout, ": ") - writeln(stdout, a[1]) + writeLine(stdout, a[1]) write(stdout, "x") write(stdout, ": ") - writeln(stdout, x) + writeLine(stdout, x) -However, the symbols ``write``, ``writeln`` and ``stdout`` are already bound +However, the symbols ``write``, ``writeLine`` and ``stdout`` are already bound and are not looked up again. As the example shows, ``bindSym`` does work with overloaded symbols implicitly. diff --git a/doc/manual/trmacros.txt b/doc/manual/trmacros.txt index 5ff24a36a..453e5f451 100644 --- a/doc/manual/trmacros.txt +++ b/doc/manual/trmacros.txt @@ -272,7 +272,7 @@ parameter is of the type ``varargs`` it is treated specially and it can match .. code-block:: nim template optWrite{ write(f, x) - ((write|writeln){w})(f, y) + ((write|writeLine){w})(f, y) }(x, y: varargs[expr], f: File, w: expr) = w(f, x, y) diff --git a/doc/tut2.txt b/doc/tut2.txt index 966423844..83ea9ad33 100644 --- a/doc/tut2.txt +++ b/doc/tut2.txt @@ -207,7 +207,7 @@ for any type: echo("abc".len) # is the same as echo(len("abc")) echo("abc".toUpper()) echo({'a', 'b', 'c'}.card) - stdout.writeln("Hallo") # the same as writeln(stdout, "Hallo") + stdout.writeLine("Hallo") # the same as writeLine(stdout, "Hallo") (Another way to look at the method call syntax is that it provides the missing postfix notation.) @@ -217,9 +217,9 @@ So "pure object oriented" code is easy to write: .. code-block:: nim import strutils - stdout.writeln("Give a list of numbers (separated by spaces): ") + stdout.writeLine("Give a list of numbers (separated by spaces): ") stdout.write(stdin.readLine.split.map(parseInt).max.`$`) - stdout.writeln(" is the maximum!") + stdout.writeLine(" is the maximum!") Properties @@ -535,7 +535,7 @@ containers: add(root, newNode("hello")) # instantiates ``newNode`` and ``add`` add(root, "world") # instantiates the second ``add`` proc for str in preorder(root): - stdout.writeln(str) + stdout.writeLine(str) The example shows a generic binary tree. Depending on context, the brackets are used either to introduce type parameters or to instantiate a generic proc, @@ -580,7 +580,7 @@ simple proc for logging: debug = true proc log(msg: string) {.inline.} = - if debug: stdout.writeln(msg) + if debug: stdout.writeLine(msg) var x = 4 @@ -597,7 +597,7 @@ Turning the ``log`` proc into a template solves this problem: debug = true template log(msg: string) = - if debug: stdout.writeln(msg) + if debug: stdout.writeLine(msg) var x = 4 @@ -627,10 +627,10 @@ via a special ``:`` syntax: quit("cannot open: " & fn) withFile(txt, "ttempl3.txt", fmWrite): - txt.writeln("line 1") - txt.writeln("line 2") + txt.writeLine("line 1") + txt.writeLine("line 2") -In the example the two ``writeln`` statements are bound to the ``body`` +In the example the two ``writeLine`` statements are bound to the ``body`` parameter. The ``withFile`` template contains boilerplate code and helps to avoid a common bug: to forget to close the file. Note how the ``let fn = filename`` statement ensures that ``filename`` is evaluated only @@ -684,7 +684,7 @@ variable number of arguments: # add a call to the statement list that writes ": " result.add(newCall("write", newIdentNode("stdout"), newStrLitNode(": "))) # add a call to the statement list that writes the expressions value: - result.add(newCall("writeln", newIdentNode("stdout"), n[i])) + result.add(newCall("writeLine", newIdentNode("stdout"), n[i])) var a: array[0..10, int] @@ -699,15 +699,15 @@ The macro call expands to: .. code-block:: nim write(stdout, "a[0]") write(stdout, ": ") - writeln(stdout, a[0]) + writeLine(stdout, a[0]) write(stdout, "a[1]") write(stdout, ": ") - writeln(stdout, a[1]) + writeLine(stdout, a[1]) write(stdout, "x") write(stdout, ": ") - writeln(stdout, x) + writeLine(stdout, x) |