ChaiScript has an object system built in, for types defined within the ChaiScript system.
attr Rectangle::height
attr Rectangle::width
def Rectangle::Rectangle() { this.
height = 10; this.width = 20 }
def Rectangle::area() { this.
height * this.width }
void print(const VoxFrame &f)
Definition GameApi.cc:22580
line height
Definition meshpage.php:3536
Boxed_Value var(T &&t)
Creates a Boxed_Value. If the object passed in is a value type, it is copied. If it is a pointer,...
Definition boxed_value.hpp:387
Since ChaiScript 5.4.0 it has been possible to use the "class" keyword to simplify this code.
class Rectangle {
attr width
def Rectangle() { this.
height = 10; this.width = 20 }
def area() { this.
height * this.width }
}
- See also
- attr
-
def