Skip to content

Commit b973b4b

Browse files
committed
odin first class types example
1 parent 219d4de commit b973b4b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

content/posts/odin-guide.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ This is a table that hold a comparison of all fundamental types you should know
3636
| type identifier | `typeid` | `Type` |
3737
| null | `nil` | `null` |
3838

39+
In odin types are first class, meaning types are values.
40+
This means functions are values and can be assigned like any other value.
41+
All types like `int` and `float` are of type `typeid`.
42+
43+
```odin
44+
a: typeid = int; // a is int
45+
b: a = 1; // b is now an int
46+
```
3947

4048
## Loops
4149

0 commit comments

Comments
 (0)