diff options
author | Araq <rumpf_a@web.de> | 2012-08-16 17:54:11 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-08-16 17:54:11 +0200 |
commit | e4c432387eb80817ed2557cfbd100be7fb0525e7 (patch) | |
tree | 29e53187e77f75d56d5aff334e17b9bba6db45b9 /doc | |
parent | d37fe6e0a5cc414c24dbff485ee656cc6f16eed8 (diff) | |
download | Nim-e4c432387eb80817ed2557cfbd100be7fb0525e7.tar.gz |
bycopy/byref for object/tuple types
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/manual.txt | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/manual.txt b/doc/manual.txt index ed80984d7..5933691b0 100755 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -2836,7 +2836,7 @@ Ordinary vs immediate templates There are two different kinds of templates: `immediate`:idx: templates and ordinary templates. Ordinary templates take part in overloading resolution. As -such their arguments needs to be type checked before the template is invoked. +such their arguments need to be type checked before the template is invoked. So ordinary templates cannot receive undeclared identifiers: .. code-block:: nimrod @@ -3657,6 +3657,25 @@ identifier *exactly as spelled*: Note that this pragma is somewhat of a misnomer: Other backends will provide the same feature under the same name. + + +Bycopy pragma +------------- + +The `bycopy`:idx: pragma can be applied to an object or tuple type and +instructs the compiler to pass the type by value to procs: + +.. code-block:: nimrod + type + TVector {.bycopy, pure.} = object + x, y, z: float + + +Byref pragma +------------ + +The `byref`:idx: pragma can be applied to an object or tuple type and instructs +the compiler to pass the type by reference (hidden pointer) to procs. Varargs pragma |