Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
33c095c4
Commit
33c095c4
authored
2 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Add an example of builtin function embedding into a user function
parent
dc37c250
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!145
git subrepo clone git@gitlab.com:OlMon/org-themes.git packages/org-themes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/userdoc.org
+12
-0
12 additions, 0 deletions
doc/userdoc.org
with
12 additions
and
0 deletions
doc/userdoc.org
+
12
−
0
View file @
33c095c4
...
...
@@ -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>>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment