diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2016-01-26 09:40:44 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2016-01-26 10:10:08 +0100 |
commit | cd574d197646f6d77bc6045d9bdc16982fc14548 (patch) | |
tree | 58bd4ce5c93fa12c089bea8de50cc4210ac821b3 /doc/manual/procs.txt | |
parent | 4246f660ea4ba7bab05811662eb53a87cc0cc049 (diff) | |
download | Nim-cd574d197646f6d77bc6045d9bdc16982fc14548.tar.gz |
Promote "echo" syntax without parenthesis
Diffstat (limited to 'doc/manual/procs.txt')
-rw-r--r-- | doc/manual/procs.txt | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/manual/procs.txt b/doc/manual/procs.txt index 654893286..9ce92de0d 100644 --- a/doc/manual/procs.txt +++ b/doc/manual/procs.txt @@ -129,9 +129,9 @@ to supply any type of first argument for procedures: .. code-block:: nim - echo("abc".len) # is the same as echo(len("abc")) - echo("abc".toUpper()) - echo({'a', 'b', 'c'}.card) + echo "abc".len # is the same as echo len "abc" + echo "abc".toUpper() + echo {'a', 'b', 'c'}.card stdout.writeLine("Hallo") # the same as writeLine(stdout, "Hallo") Another way to look at the method call syntax is that it provides the missing @@ -486,7 +486,7 @@ state are automatically saved between calls. Example: inc(i) for ch in items("hello world"): # `ch` is an iteration variable - echo(ch) + echo ch The compiler generates code as if the programmer would have written this: @@ -494,7 +494,7 @@ The compiler generates code as if the programmer would have written this: var i = 0 while i < len(a): var ch = a[i] - echo(ch) + echo ch inc(i) If the iterator yields a tuple, there can be as many iteration variables |