summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-09-03 11:40:14 +0200
committerAraq <rumpf_a@web.de>2018-09-03 11:40:14 +0200
commit602aeef4d4d70b9fe8c6a1e318538697b3e23bfc (patch)
tree729cdc87fe230b28230f1eeeba8ab96af155fe16 /doc
parent4993274f2fd41eaa23ed83a85777df4320fadbf9 (diff)
downloadNim-602aeef4d4d70b9fe8c6a1e318538697b3e23bfc.tar.gz
manual: document the 'unsafeAddr' operator; closes #5038
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/manual.rst b/doc/manual.rst
index 6e1030e7e..e3199cecf 100644
--- a/doc/manual.rst
+++ b/doc/manual.rst
@@ -3105,6 +3105,19 @@ the address of variables, but one can't use it on variables declared through
   # Error: expression has no address
 
 
+The unsafeAddr operator
+-----------------------
+
+For easier interoperability with other compiled languages such as C, retrieving
+the address of a ``let`` variable, a parameter or a ``for`` loop variable, the
+``unsafeAddr`` operation can be used:
+
+.. code-block:: nim
+
+  let myArray = [1, 2, 3]
+  foreignProcThatTakesAnAddr(unsafeAddr myArray)
+
+
 Procedures
 ==========