Cheatsheet
The Engine
A Bia engine can be initialized like this:
Executing a Script
The execute()
function of the engine takes a std::istream
for the script. It compiles and runs the code immediately:
Language Reference
Variables
| let x = 0
let x: int = 0
x = 1 // 'x' is immutable
let mut x = 0
x = 0 // is now accepted
drop x // 'x' is now unkown
|
Scopes
| scope {
let x = 0
}
print(x) // 'x' is undefined
|
Looping
Condition Based
| while true {
let line = io.read("> ")
if not line {
break
}
io.print("< You said:", line)
}
|
Conditionals
| if x and not y {
io.print(x)
} else if y {
io.print(y)
}
|