init
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
double: i32 -> i32: @ value: i32 { value * 2 }
|
||||
|
||||
square: i32 => i32: @ value: i32 { value * value }
|
||||
|
||||
add: (i32, i32) -> i32: @ (left: i32, right: i32) { left + right }
|
||||
|
||||
normalize: i32 -> i32: @ value: i32 {
|
||||
adjusted := value + 1
|
||||
adjusted->double
|
||||
}
|
||||
|
||||
apply: (i32, i32 -> i32) -> i32: @ (value, operation): {(i32, i32 -> i32)} { value->operation }
|
||||
|
||||
factory: i32 => i32 -> i32: @ offset: i32 { @ value: i32 { value + offset } }
|
||||
|
||||
initialize: () -> i32: @ () { 1 }
|
||||
|
||||
computed := (4, @ value: i32 { value + 1 })->apply
|
||||
Reference in New Issue
Block a user