File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ This means functions are values and can be assigned like any other value.
4141All types like ` int ` and ` float ` are of type ` typeid ` .
4242
4343``` odin
44- a :: = int; // a is int
44+ a :: int; // a is int
4545b: a = 1; // b is now an int
4646```
4747
@@ -136,6 +136,14 @@ foo = x when condition else y // compile time ternary
136136
137137## References
138138
139+ In odin there are no references like in C++ and no reference types like in C#, Odin is similar to C in that you need a pointer to reference variables.
140+
141+ When passing a value as an argument, it passes as a pointer if automatically if its more effecient
142+ this is enabled by the fact that all parameters are immutable in Odin, making it feel like everything is always copied like in c.
143+ Passing a pointer value makes a copy of the pointer, not the data it points to.
144+ slices, dynamic arrays, and maps have no special considerations here,
145+ they are normal structs with pointer fields, and are passed as such, in that regard they work like reference types.
146+
139147## Memory
140148
141149## Pointers
You can’t perform that action at this time.
0 commit comments