From 39fe85612bc4c549d9513901b6fda9f0f9bceb78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com>
Date: Wed, 1 Jun 2022 12:29:33 +0200
Subject: [PATCH] Add a short description of builtin functions

We mainly describe their differences with user-defined onces
---
 doc/userdoc.org | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/doc/userdoc.org b/doc/userdoc.org
index e06853aec..d81ee102d 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
-- 
GitLab