Object oriented

class

Define a class: fields, a constructor, and methods, closed with end;.

Syntax

define class <Name>;
  ...
end;

How she behaves

  • The class name is also a type: define Person jacob is newobj Person(...);
  • Switch public: and private: inside the class to hide fields and helpers.
  • The class body ends with end;, like a function.

Example

define class Person;
private:
define str name is "Unknown";
public:
define constructor(str name);
    redefine self.name is name;
end;
end;

See also