Each class should be allowed to have functions that can't be reached from outside the class.
Much like java, and swift... we could do something similar.
eg.
class A {
A(str) {
this.str = str;
}
canUse() {
say "Able to use this function";
}
internal cantUse() {
say "Only internal functions can use me.";
say this.str;
}
useBoth() {
this.canUse();
this.cantUse();
}
}
>> let a = A("wow");
>> a.canUse(); // Can use... as its public
Able to use this function
>> a.cantUse(); // Wont be able to use... as its internal
Sorry, this is a private class!
>> a.useBoth(); // Can use... as its a public function, accessing a private function in the same class
Able to use this function
Only internal functions can use me.
wow
>>
Each class should be allowed to have functions that can't be reached from outside the class.
Much like java, and swift... we could do something similar. eg.