Brevis

Declarations

A variable x can be declared with let x = definition;. Functions have no special syntax for declaration.

Functions

Functions are always anonymous, are:

  • Declared as fn(x, y, z) { body }
  • First-class values that can be passed as arguments to other functions
  • Able to capture their arguments
  • Called with the syntax f(x, y, z)

Conditionals

Currently, only the if conditional is supported, via the syntax if cond { body } else { body }, where the else part is optional. If-expressions are value expressions, so code such as if b { "true" } else { "false" } can be used to stringify booleans.