lang_2023/tests/default_constructors.lang

19 lines
475 B
Text
Raw Normal View History

2023-06-03 19:01:03 +03:00
namespace \employee {
decl gen-employee : \unit -> \employee
def gen-employee = {
var x = $@complex & 11.3 & 15.87 // construct on heap
2023-03-31 12:10:12 +03:00
return
2023-06-03 19:01:03 +03:00
$employee // construct on stack
2023-03-31 12:10:12 +03:00
& name = "John"
& role =
2023-06-03 19:01:03 +03:00
($manager
2023-04-25 21:21:36 +03:00
& "John"
2023-03-31 12:10:12 +03:00
& productivity =
2023-06-03 19:01:03 +03:00
($productivity.high
2023-03-31 12:10:12 +03:00
& duration = 10.3
2023-06-03 19:01:03 +03:00
& sleep-on-work = ($productivity.sleep-on-work.no))
2023-03-31 12:10:12 +03:00
& salary = 123)
2023-03-31 12:10:12 +03:00
}
}