classes / enums / interfaces / services / serviceinterfaces =========================================================== See also `class_kinds_keywords.txt` The kinds of types could be: classes enums interfaces services service interfaces There are some constraints: * enums can have a constructor, but it can only be accessed locally to instantiate the enum values. * interfaces cannot have constructors or fields * service interfaces might have abstract constructors, but not fields * services might have a specific constructor (or just an optional zero-argument constructor?) Declaration ordering constraints: * Fields must already come before functions/constructors * Require constructors to come before functions? * Require the following to come before anything else (anything else would implicitly be considered to be a class that doesn't implement any interfaces): - enum values - class/service "implements" lines - interface/service interface specifiers * Don't require any particular ordering of service entry points? Should it be required to declare exported services/entry's? See also `main_startup.txt` Syntax test ----------- Class, normal: int x int y Class, implementing an interface: implements SomeInterface impl to_string returns String s code ... end Enum: typekind enum values # `new` could be implicit, unless another constructor is specified red = 255 0 0 green = 0 255 0 yellow = 255 255 0 blue = 0 0 255 end Interfaces typekind interface func to_string returns String s end Services # TODO more inuitive syntax/keywords than `typekind service ...` # TODO should maybe have mulitple lines typekind service CLIApp # or this: servicetype CLIApp # or this: (best?) be CommandMain # TODO more inuitive syntax/keywords than `inject` inject CLIParams params entry main code ... end Service Interfaces typekind serviceinterface # TODO more inuitive keyword than `injectable` injectable CLIParams params entry main end