commit b83336f7e3bb65735a76d7a92726e2fa23b8f4a1 Author: Eric Christensen Date: Thu Jul 30 09:05:56 2026 -0700 init diff --git a/main.odin b/main.odin new file mode 100644 index 0000000..c878fd6 --- /dev/null +++ b/main.odin @@ -0,0 +1,58 @@ +package main + +import "core:fmt" + +five: int = 5 +six: int = 6 + +foo :: proc(p: ^int) { + fmt.println("p memory address: ", p) + fmt.println("value of p: ", p^) + p = &six + + // p DROPPED here + // a in main() is not changed +} + + +bar :: proc(pp: ^^int) { + fmt.println("pp memory address: ", pp) + fmt.println("pp memory address deferenced: ", pp^) + pp^ = &six + + // pp DROPPED here +} + +dez :: proc() -> ^int { + return &six +} + +main :: proc() { + + fmt.println("memory space of 5: ", &five) + fmt.println("memory space of 6: ", &six) + + a := &five + + // YOU CAN'T CALL FOO + // fmt.println("~~~~~~~~~~~~~~~~~~~~~~~~\n") + // fmt.println("CALL TO FOO WITH PARAM P") + // fmt.println("a memory address: ", a) + // foo(a) + // fmt.println("a memory address: ", a) + + + fmt.println("~~~~~~~~~~~~~~~~~~~~~~~~\n") + fmt.println("CALL TO BAR WITH PARAM PP") + fmt.println("a memory address: ", a) + bar(&a) + fmt.println("a memory address: ", a) + fmt.println("value of a: ", a^) + + + fmt.println("~~~~~~~~~~~~~~~~~~~~~~~~\n") + b := &five + fmt.println("b memory space and value", b, b^) + b = dez() + fmt.println("b memory space and value", b, b^) +} diff --git a/ols.json b/ols.json new file mode 100644 index 0000000..90e2150 --- /dev/null +++ b/ols.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/ols.schema.json", + "enable_document_symbols": true, + "enable_hover": true, + "enable_snippets": true +} \ No newline at end of file