-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinclude_lib.fun
More file actions
executable file
·33 lines (26 loc) · 865 Bytes
/
include_lib.fun
File metadata and controls
executable file
·33 lines (26 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env fun
/*
* This file is part of the Fun programming language.
* https://fun-lang.xyz/
*
* Copyright 2025 Johannes Findeisen <you@hanez.org>
* Licensed under the terms of the Apache-2.0 license.
* https://opensource.org/license/apache-2-0
*/
// Demonstrates system library includes after installation to /usr/lib/fun
// includes can also be done with a leading # like in C, but some programmers maybe like more clean code without a
// leading #.
include <hello.fun>
include <utils/math.fun>
print("== include lib demo ==")
hello_lib()
number x = 10
number y = 32
print("add(" + to_string(x) + ", " + to_string(y) + ") = " + to_string(add(x, y)))
print("times(" + to_string(x) + ", " + to_string(y) + ") = " + to_string(times(x, y)))
/* Expected output:
== include lib demo ==
Hello from system lib!
add(10, 32) = 42
times(10, 32) = 320
*/