Build systems: CMake
1. Create a build directory and navigate into it
mkdir build
cd build
- Build a project with CMake
cmake ..
make
sudo make install
# if possible use -j4 with make
2. Run file. Usage: "cfp [path-to-file]". In Froppy variables are not bound to a specific data type.
let x; // by default, it is initialized to nil
println(x); // >> "nil"
x = 52; // now it is a integer
println(x); // >> 52
fn factory() {
fn instance() {
println("factory::instance");
}
return instance; // return inner function
}
let foo = factory();
foo(); // >> "factory::instance"
class base {
let x;
fn setX(x_) {
x = x_;
}
fn getX() {
return x;
}
}
class derived : base { // derived is inherited from base
fn setX(x_) { // override method
x=x_*2;
}
}
let d = derived();
d.setX(3); // use overrided setX method
printlb(d.getX()); // >> 6