aboutsummaryrefslogtreecommitdiff
path: root/examples/mem.sloth
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2023-12-01 22:20:07 -0600
committerNic Gaffney <gaffney_nic@protonmail.com>2023-12-01 22:20:07 -0600
commitd767828cee67bae17b811062949653234aa14b28 (patch)
tree0a0306acc0fb9db19e6f7eff636d81c44209ee5d /examples/mem.sloth
parent52f12c6c2c946d8d3c0a7845d48e11ff8b8fb597 (diff)
downloadsloth-d767828cee67bae17b811062949653234aa14b28.tar.gz
shitty ptrs
Diffstat (limited to 'examples/mem.sloth')
-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));
+}