Classes
Classes are a feature implemented as part of the language runtime. A class
definition gets lowered to a struct that exhibits the same interface as the
class definition and implements the ABI underlying the specific type of class.
⚠️ TODO
❌ Not Implemented
Example
extern(C++)
class MyClass {
private {
var _number: int;
}
this(num: int)
{
_number = num;
}
method foo() { print(num); }
}
function main()
{
var c = new(MyClass, 42);
c.foo();
}