Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Expressions

Raptor supports a limited form of inline literal expressions (i.e. “values”), that can be specified when using the INCLUDE and RENDER instructions.

Booleans

Boolean values work identically to json (and many other languages):

LiteralValue
truetrue
falsefalse

Integers

Integer values are supported.

Be aware that raptor always uses i64 (signed 64-bit) integers.

This is unlike the typical json implementations, that uses f64 (64-bit floating-point) numbers, in two important ways:

A) The valid range for i64 integers is -9223372036854775808 to 9223372036854775807, inclusive. This should be sufficient for most applications. Any integer in this range will be represented exactly.

B) Floating-point (i.e. fractional) numbers are not supported. For example, 3.14 is not valid in raptor. Instead, consider passing such a value as a string.

Currently, alternate integer bases (i.e. hexadecimal or octal) are not supported.

Strings

String are supported, and work much like they do in json, or other common notations.

Tip

See the section on string escapes for more details.

Lists

Lists are supported, with a syntax very similar to json. The only difference is that raptor allows an optional trailing comma after the last list element, while json does not.

Examples of lists

[1, 2, 3]
[true, false]
[["a", "b"], 123]

Maps

Maps (also typically known as dicts or hashmaps) contain a set of (key, value) pairs.

The syntax is similar to json. Like lists, raptor allows an optional trailing comma after the last key-value pair.

Examples of maps

{"answer": 42}
{"name": "Heart of Gold", "engine": "Improbability drive"}