Extend is a new feature in my language that is added to reduce complexity of large classes.
Extend basically is like importing a library but inside the class so that functionality within a class can be separated.
This just show the functionality of it. You could basically share some functions between classes and separate them how ever you want. It also useful to cluster functions into a separate file.
class T
    int a = 0
    T int a => do this->a = a
    extend T/example
;
class P
    int a = 0
    P int a => do this->a = a
    extend T/example
;
//file T/example.ha
fn reset => do a = 0
fn add_one => do a++
 
     
                                
Comments (0)