aboutsummaryrefslogtreecommitdiff
path: root/examples/callback.fwd
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-01-09 22:26:02 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-01-09 22:26:02 +0200
commit598be4cd1bdd79e4859ae30291f4d65682cc672a (patch)
tree6e7e7ad537214c78049c4b3b2ee694c3b549fa4e /examples/callback.fwd
parent6f7c2d6daa5c706d441ddc42c5c6409e5266049a (diff)
downloadfwd-598be4cd1bdd79e4859ae30291f4d65682cc672a.tar.gz
fwd-598be4cd1bdd79e4859ae30291f4d65682cc672a.zip
initial reference checking
Diffstat (limited to 'examples/callback.fwd')
-rw-r--r--examples/callback.fwd16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/callback.fwd b/examples/callback.fwd
new file mode 100644
index 0000000..f750b8b
--- /dev/null
+++ b/examples/callback.fwd
@@ -0,0 +1,16 @@
+fwd_println(auto s);
+
+callee()
+{
+ fwd_println("Hello from callback!");
+}
+
+caller(*() callback)
+{
+ callback();
+}
+
+main()
+{
+ caller(callee);
+}