Odin v0.7.1
Patch Changes
- Update version string
- Update command line usage text
New Features
- New importation system
import
using import
export
- Import collections
- `import "core:fmt.odin"
import "shared:glfw.odin"
-collection=foo=path/to/foo
- Improved
foreign
systemforeign import
foreign
blocksforeign export
blocksforeign import "system:kernel32.lib"
- Global variable dependency initialization ordering
- Attribute system
@(link_name="gb_foo") foo :: proc() {};
@(link_prefix="gb_") foo :: proc() {};
- Please see wiki for more
- Array Programming - arithmetic on fixed length arrays
a, b: [4]f32;
c := 2*(-a + b) / 3;
d := swizzle(c, 1, 0, 3, 2);
uintptr
- Type aliases
My_Int :: #alias int;
inline
andno_inline
prefix keywords for procedure literalsfoo :: inline proc() {}
- Procedure calling convention syntax
proc "c" ()
proc "std" ()
proc "contextless" ()
- Default arguments allowed after a variadic parameter
print :: proc(args: ...any, loc := #caller_location) {}
- Polymorphic array lengths
proc(a: [$N]$T)
Syntax Changes
switch
replacesmatch
context <- expr {}
replacespush_context expr {}
push_allocator
has been removed in favour of general procedures to generate contexts-build-mode=dll
replacesbuild-dll
Core library additions
mem.ptr_to_bytes
assert
andpanic
useprintf
style parameters