Skip to content
Snippets Groups Projects
Commit 33c095c4 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add an example of builtin function embedding into a user function

parent dc37c250
Branches
Tags
1 merge request!145git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
......@@ -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>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment