lang_2023/tests/default_constructors.lang

44 lines
874 B
Text
Raw Normal View History

2023-03-31 12:10:12 +03:00
namespace Employee {
decl gen_employee : Unit -> Employee
def gen_employee = {
return
$Employee
& name = "John"
& role =
($Manager
& name = "John"
& productivity =
($Productivity.High
& duration = 10.3
& sleep_on_work = ($Productivity.SleepOnWork.No))
& salary = 123)
2023-03-31 12:10:12 +03:00
}
}
/*
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)
*/