Advanced Functions in BER

Note: "Bernardo" is the real name of the BER creator. Please respect privacy and no drama.

Function Parameters

BER functions can accept parameters. Here’s how you do it:

function add(a, b)
    board:(a + b)
end

add(5, 10)

Simulated Return Values

BER doesn’t have return statements, but you can simulate returning by using variables or outputting values:

function get.name()
    board:("Bernardo")
end

get.name()

Nested Functions

You can define functions inside functions to organize code:

function outer()
    function inner()
        board:("Inside inner!")
    end
    inner()
end

outer()

Function Names with Dots

You can name functions like object.method(), to simulate methods:

function project.build()
    board:("Building project...")
end

project.build()

Tips