From 9ed984201db1c16d91c3137b622008afb19dfc5a Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sat, 21 Jun 2014 19:35:40 +0200 Subject: [PATCH] Hyperlinks together importc like pragmas. --- doc/manual.txt | 5 ++++- doc/nimrodc.txt | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/manual.txt b/doc/manual.txt index 3af41faecf..2f0387b19f 100644 --- a/doc/manual.txt +++ b/doc/manual.txt @@ -5488,7 +5488,10 @@ spelled*: proc printf(formatstr: cstring) {.header: "", importc: "printf", varargs.} Note that this pragma is somewhat of a misnomer: Other backends will provide -the same feature under the same name. +the same feature under the same name. Also, if you are interfacing with C++ +you can use the `ImportCpp pragma `_ and +interfacing with Objective-C the `ImportObjC pragma +`_. Exportc pragma diff --git a/doc/nimrodc.txt b/doc/nimrodc.txt index fea1037dad..58c234bcb9 100644 --- a/doc/nimrodc.txt +++ b/doc/nimrodc.txt @@ -384,10 +384,11 @@ Example: ImportCpp pragma ---------------- -The ``importcpp`` pragma can be used to import `C++`:idx: methods. The -generated code then uses the C++ method calling syntax: ``obj->method(arg)``. -In addition with the ``header`` and ``emit`` pragmas this allows *sloppy* -interfacing with libraries written in C++: +Similar to the `importc pragma for C `_, the +``importcpp`` pragma can be used to import `C++`:idx: methods. The generated +code then uses the C++ method calling syntax: ``obj->method(arg)``. In +addition with the ``header`` and ``emit`` pragmas this allows *sloppy* +interfacing with libraries written in C++: .. code-block:: Nimrod # Horrible example of how to interface with a C++ engine ... ;-) @@ -422,11 +423,11 @@ emits C++ code. ImportObjC pragma ----------------- -The ``importobjc`` pragma can be used to import `Objective C`:idx: methods. -The generated code then uses the Objective C method calling -syntax: ``[obj method param1: arg]``. -In addition with the ``header`` and ``emit`` pragmas this allows *sloppy* -interfacing with libraries written in Objective C: +Similar to the `importc pragma for C `_, the +``importobjc`` pragma can be used to import `Objective C`:idx: methods. The +generated code then uses the Objective C method calling syntax: ``[obj method +param1: arg]``. In addition with the ``header`` and ``emit`` pragmas this +allows *sloppy* interfacing with libraries written in Objective C: .. code-block:: Nimrod # horrible example of how to interface with GNUStep ...