Skip to content

Odin v0.5.0

Compare
Choose a tag to compare
@gingerBill gingerBill released this 27 Jun 16:56
· 12881 commits to master since this release

Changes

  • C-style varargs
    • #c_vararg
  • foreign declaration blocks
foreign libc {
	var errno: i32;
	proc c_printf(fmt: ^u8, #c_vararg args: ..any) -> i32 #cc_c #link_name "printf";
}
  • expand_to_tuple
  • Default procedure arguments
proc hello(a: int = 9, b = 9) {
	fmt.printf("a is %d; b is %d\n", a, b);
}
  • Default return values
proc foo(x: int) -> (first: string = "Hellope", second = "world!") {
	return;
}
  • Named procedure arguments
    • hello(b = 123, a = 321);
  • Named return values
    • return a = 123, b = "blah";
  • #location() and #caller_location
  • Explicit parametric polymorphic procedures
    • proc new(T: type) -> ^T { ... };
  • Command line arguments
    • -opt=0,1,2,3