aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authornic-gaffney <gaffney_nic@protonmail.com>2023-12-05 06:51:38 -0600
committernic-gaffney <gaffney_nic@protonmail.com>2023-12-05 06:51:38 -0600
commitf655a862106a8a05bc432c2df957979f3fcc399b (patch)
tree28134136bdbbaa5dc423403f0985ccf8fb60e861 /examples
parentc748aedbc265fdc7d62768d368161a1f1d88b9a4 (diff)
parentd767828cee67bae17b811062949653234aa14b28 (diff)
downloadsloth-f655a862106a8a05bc432c2df957979f3fcc399b.tar.gz
merge
Diffstat (limited to 'examples')
-rw-r--r--examples/mem.sloth9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/mem.sloth b/examples/mem.sloth
new file mode 100644
index 0000000..cb52191
--- /dev/null
+++ b/examples/mem.sloth
@@ -0,0 +1,9 @@
+fn main() {
+ var intpointer: Int = memalloc(64);
+ println("We vibin");
+ assignrefi(intpointer, 10);
+ println("Still vibin");
+ var derefd: Int = drefi(intpointer);
+ print("Val of drefd: ");
+ println(istr(derefd));
+}