diff --git a/doc/userdoc.org b/doc/userdoc.org index e06853aecdb62e60a340120ecef5483f6d236806..d81ee102d1f1b458a80d50732ebbe1acc133e96c 100644 --- a/doc/userdoc.org +++ b/doc/userdoc.org @@ -2300,9 +2300,24 @@ there would be no way to end the recursion. Thus, the code produces the following compilation time error #+results: no-recursion -*** TODO Builtin functions<<builtin-functions>> - -** TODO modules +*** Builtin functions<<builtin-functions>> + +In ~pugs~ language, builtin functions are ~C++~ pieces of code that can be +called in scripts. There usage is very similar to user-defined +functions. They differ from user-defined functions in three points. +- Builtin functions can have no parameter or no returned value. +- Builtin functions are polymorphic. More precisely, this means that + the signature of a builtin function is also defined by its expected + arguments types. +- Builtin functions can take user-defined functions as parameters. + - user-defined functions cannot take functions as parameters + - builtin functions cannot take builtin functions as parameters + (actually, this is not a limitation since it is trivial to embed a + builtin function into a user-defined one). + +Builtin functions are defined when modules are imported, see [[modules]]. + +** TODO modules<<modules>> [fn:pugs-def] ~pugs~: Parallel Unstructured Grid Solvers