Class == function
There is no distinction between a class and a function they are the same thing.
Here is what a class definition looks like
class( x := 0 method1() { x += 1 } method2() { x += 2 } ) { this }
The { this } means that the function class is returning the object used to store all of the variables and inner functions from this function.
{ this }
class
Because a class is a function, creating a class is the same as calling a function
c : class(x : 1)
Class with a constructor
class( x : 2 method1() { } ) { if (x == 0) { throw "x cannot be zero" } this } c : class(x : 0)
There was an error while loading. Please reload this page.