aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/namespaces.halk11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/namespaces.halk b/examples/namespaces.halk
new file mode 100644
index 0000000..c8511be
--- /dev/null
+++ b/examples/namespaces.halk
@@ -0,0 +1,11 @@
+:nsp:people = {
+ ` Get a person's age at a specific year. `
+ :int:get_age.:nsp:person,:int:year = -.year, person:birthyear
+}
+
+:nsp:john = {
+ :int:birthyear = 2000;
+ :str:name = "John Doe";
+}
+
+print.people:get_age.john;