Overview

Objects

Basics on and differences between static and dynamic objects.

Tutorial

Objects and classes

Ruota is both partly object-oriented and functional, it is functional in the way you can't do

"this is my string".replace('x', 'y');

but you can do

String.replace("this is my string", 'x', 'y')

, and it's object-oriented in the way it has classes (in the form of dynamic objects) and objects (in the form of static objects).

Static objects

To define a static object you use the following syntax.

static MyObject :: {

    foo := "bar";

    hello := "world";

};

This is useful cause we can now group variables into one place, so now we can do this to access these 'grouped variables'.

printl(MyObject.hello);

Dynamic objects

To define a dynamic object you use the same syntax as static objects, but substituting the static keyword for the dynamic keyword. One of the major differences between static objects is you need to instantiate them, like classes in other languages.

a := new MyObject();

printl(a.hello);