What's New
bit_field- Lexical Sugar:
≠,≤,≥ u128i128- Label syntax change:
name: for { break name; }
%%divisor based modulo operator"bits.odin"- Casting syntax change:
- Regular cast:
type(expr) - Bit cast:
transmute(type, expr) - Type assertion (replaces
union_cast):expr.(type)
- Regular cast:
- Address of operator
&replacing^- Pointer types and dererefencing still use
^
- Pointer types and dererefencing still use
default:replaced withcase:#orderedreimplemented#no_alias(replacing keywordno_alias)- XOR for booleans
runeas a basic type rather than alias ofi32- Provides extra type information at runtime
byteis removed- Use
u8instead
- Use
- Removed
quaternion128andquaternion256
Naming Convention
Odin has finally chose an official naming convention
In general, PascalCase for types and snake_case for values.
Import Name: snake_case (but prefer single word)
Types: PascalCase
Union Variants: PascalCase
Enum Values: PascalCase
Procedures: snake_case
Local Variables: snake_case
Field Values: snake_case
Constant Variables: SCREAMING_SNAKE_CASE