mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-01 19:02:13 +00:00
Closed range ... (both inclusive); Type comparisons with == and !=
This commit is contained in:
@@ -10,46 +10,45 @@
|
||||
#import "utf8.odin";
|
||||
|
||||
main :: proc() {
|
||||
foo :: proc(x: ^i32) -> (int, int) {
|
||||
fmt.println("^int");
|
||||
return 123, int(x^);
|
||||
}
|
||||
foo :: proc(x: rawptr) {
|
||||
fmt.println("rawptr");
|
||||
}
|
||||
// foo :: proc(x: ^i32) -> (int, int) {
|
||||
// fmt.println("^int");
|
||||
// return 123, int(x^);
|
||||
// }
|
||||
// foo :: proc(x: rawptr) {
|
||||
// fmt.println("rawptr");
|
||||
// }
|
||||
|
||||
// THINGI :: 14451;
|
||||
// THINGF :: 14451.1;
|
||||
|
||||
THINGI :: 14451;
|
||||
THINGF :: 14451.1;
|
||||
// a: i32 = 111111;
|
||||
// b: f32;
|
||||
// c: rawptr;
|
||||
// fmt.println(foo(^a));
|
||||
// foo(^b);
|
||||
// foo(c);
|
||||
// // foo(nil);
|
||||
// atomic.store(^a, 1);
|
||||
|
||||
a: i32 = 111111;
|
||||
b: f32;
|
||||
c: rawptr;
|
||||
fmt.println(foo(^a));
|
||||
foo(^b);
|
||||
foo(c);
|
||||
// foo(nil);
|
||||
atomic.store(^a, 1);
|
||||
// foo :: proc() {
|
||||
// fmt.printf("Zero args\n");
|
||||
// }
|
||||
// foo :: proc(i: int) {
|
||||
// fmt.printf("int arg, i=%d\n", i);
|
||||
// }
|
||||
// foo :: proc(f: f64) {
|
||||
// i := int(f);
|
||||
// fmt.printf("f64 arg, f=%d\n", i);
|
||||
// }
|
||||
|
||||
foo :: proc() {
|
||||
fmt.printf("Zero args\n");
|
||||
}
|
||||
foo :: proc(i: int) {
|
||||
fmt.printf("int arg, i=%d\n", i);
|
||||
}
|
||||
foo :: proc(f: f64) {
|
||||
i := int(f);
|
||||
fmt.printf("f64 arg, f=%d\n", i);
|
||||
}
|
||||
// foo();
|
||||
// // foo(THINGI);
|
||||
// foo(THINGF);
|
||||
// foo(int(THINGI));
|
||||
// fmt.println(THINGI);
|
||||
// fmt.println(THINGF);
|
||||
|
||||
foo();
|
||||
foo(int(THINGI));
|
||||
// foo(THINGI);
|
||||
foo(THINGF);
|
||||
fmt.println(THINGI);
|
||||
fmt.println(THINGF);
|
||||
|
||||
f: proc();
|
||||
f = foo;
|
||||
f();
|
||||
// f: proc();
|
||||
// f = foo;
|
||||
// f();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user