-
Notifications
You must be signed in to change notification settings - Fork 3
The Language
asm("<assembly here>");
<assembly here>
A function named name, with parameters and , and as a body:
func name(<p1>, <p2>) {
<body>
};
Rpp programs start in the main function. The main function takes two parameters: argc, and argv. argc is the number of command line arguments, and argv is a vector containing them.
func main(argc, argv) {
<RPP code>
};
Call a function named name, with parameters and :
name(<p1>, <p2>);
Global variable named name, with value :
var name = <value>;
⚠️ Global values are "global" because any function in the file scope can access them to make a variable truly global you must export it
Exports and Imports work on symbols (functions, variables, etc..)
import println
println("hi",2);
Imports println function, if and only if the core package is linked with the rpp output.
exports
func main(...) {...};
Exports main so it can be accessed by other files, similar to println in the example above.
To make a pointer (ap) to another variable (a):
var& ap = a;
To deference a pointer (ap) pointing to another variable (a), in (b):
var* b = ap;
// b == a