diff --git a/doc/userdoc.org b/doc/userdoc.org index a1464f4116e7d107d00bdf2421ab6b618557d60e..e98a1115106575220569112fb80d52dc15394b31 100644 --- a/doc/userdoc.org +++ b/doc/userdoc.org @@ -2295,6 +2295,18 @@ functions. They differ from user-defined functions in three points. (actually, this is not a limitation since it is trivial to embed a builtin function into a user-defined one). +Here is a simple example of builtin function embedding in a user +function. +#+NAME: builtin-function-embedding +#+BEGIN_SRC pugs :exports both :results output + import math; + + let cosinus: R -> R, x -> cos(x); + cout << "cosinus(2) = " << cosinus(2) << "\n"; +#+END_SRC +Running this example produces +#+results: builtin-function-embedding + Builtin functions are defined when modules are imported, see [[modules]]. ** TODO modules<<modules>>