[opengtl-commits] [476] add library to the spec

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 476
Author:   cyrille
Date:     2008-11-12 00:25:28 +0100 (Wed, 12 Nov 2008)

Log Message:
-----------
add library to the spec

Modified Paths:
--------------
    trunk/OpenGTL/OpenShiva/doc/specification/ShivaSpec.tex


Modified: trunk/OpenGTL/OpenShiva/doc/specification/ShivaSpec.tex
===================================================================
--- trunk/OpenGTL/OpenShiva/doc/specification/ShivaSpec.tex	2008-11-10 12:06:37 UTC (rev 475)
+++ trunk/OpenGTL/OpenShiva/doc/specification/ShivaSpec.tex	2008-11-11 23:25:28 UTC (rev 476)
@@ -153,6 +153,34 @@
   }
 \end{verbatim}
 
+\chapter{library}
+
+Libraries are used to write reusable code for Shiva Kernel, if you have
+function that you use often, you might want to put them in a library.
+
+Libraries are started with the \verb|library| keyword and can contain
+constants, and functions:
+
+\begin{verbatim}
+library MyLibrary {
+  const int value = 2;
+  int addValue(int v )
+  {
+    return v + value;
+  }
+}
+\end{verbatim}
+
+The keyword \verb|import| allows to use a library in a kernel:
+
+\begin{verbatim}
+  import mylibrary;
+  ...
+  int v = 3;
+  v = MyLibrary::addValue( v );
+\end{verbatim}
+
+
 \chapter{Types}
 
 \section{Primitive types}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/