Skip to content

Getting Started

Owen L. edited this page Oct 25, 2024 · 8 revisions

The Bean Script is entirely composed of function calls. A function can be called like so:

my_function(arg1, arg2, arg3, ...): body

Both the parameters and body are optional. Literally everything is a function, besides constant values.

To define a variable use the let function:

let(<the_answer>): "???"

The angle brackets (< and >) are a variable name. These are like strings, but have more limitations on what characters can be put in them. Namely only A-z, 0-9, and underscores can be used. This is to prevent creating functions that can never be used.

Variables are also functions, just without any arguments. To set a variable use the body:

the_answer: 42

Constants can never be modified:

const(<are_hotdogs_sandwiches>): true
are_hotdogs_sandwiches: false # error!

Functions can be created using the fn function.

fn(<greet>): {
  print("hello")
}

Clone this wiki locally