Beginning to lift the "grime" files to their own pacakge

This commit is contained in:
2024-05-31 11:26:52 -04:00
parent 65386372fc
commit 3998776f4b
27 changed files with 428 additions and 154 deletions

30
code/grime/ptr.odin Normal file
View File

@ -0,0 +1,30 @@
package grime
// Provides an alternative syntax for pointers
Ptr :: struct( $ Type : typeid ) {
v : Type,
}
exmaple_ptr :: proc()
{
a, b : int
var : ^Ptr(int)
reg : ^int
a = 1
b = 1
var = &{a}
var.v = 2
var = &{b}
var.v = 3
a = 1
b = 1
reg = (& a)
(reg^) = 2
reg = (& b)
(reg^) = 3
}