lang_2023/tests/default_constructors.lang

43 lines
874 B
Text

namespace Employee {
decl gen_employee : Unit -> Employee
def gen_employee : a = {
return
$Employee
& name = "John"
& role =
($Manager
& "John"
& productivity =
($Productivity::High
& duration = 10.3
& sleep_on_work = ($Productivity::SleepOnWork::No))
& salary = 123)
}
}
/*
class Employee =
& name : String
& role :
( | Director
& importance : Float
& share : Float
| Manager
& productivity :
( Productivity
| .Low
| .Average
| .High
& duration : Float
& sleep_on_work :
(SleepOnWork
| ..Yes
| ..No
))
& salary : Int
| Programmer
& skills : Float
& current_task : Optional Task
& salary : Int)
*/