2022-02-12 08:25:20 -06:00
|
|
|
import "path/to/library.hyc";
|
|
|
|
|
2022-02-12 07:17:13 -06:00
|
|
|
// user defined function
|
2022-02-12 07:37:28 -06:00
|
|
|
func foo :: (a, b) -> Bool = {
|
|
|
|
return a == b;
|
2022-02-12 05:29:10 -06:00
|
|
|
};
|
2022-02-12 05:51:43 -06:00
|
|
|
|
2022-02-12 07:17:13 -06:00
|
|
|
// entry point
|
2022-02-12 07:37:28 -06:00
|
|
|
func main :: () -> Int = {
|
2022-02-12 07:17:13 -06:00
|
|
|
// if else in variable definition
|
2022-02-12 08:25:20 -06:00
|
|
|
let cond_str :: String = if foo(1, 1) { return "t" } else { return "f" };
|
2022-02-12 07:21:42 -06:00
|
|
|
|
|
|
|
// Infix operator
|
|
|
|
let n :: Bool = 2 == 2;
|
2022-02-12 07:33:33 -06:00
|
|
|
// Prefix operator
|
|
|
|
let m :: Bool = !n;
|
2022-02-12 07:17:13 -06:00
|
|
|
};
|