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