Skip to content

Data types

Peter Johnson edited this page Nov 28, 2022 · 22 revisions

Data Types

⚠️⚠️ THIS WIKI IS BEING USED TO JOT DOWN IDEAS AT PRESENT. DON'T ASSUME ANYTHING IS FIXED. ⚠️⚠️

All placeholders, variables, commands and filters return data of a given type.

The supported types are given in the following table. Each type has a default string representation.

Types not yet implemented are marked with a ⛔ symbol.

Type Description Default string Truthiness
Text Plain text strings The text itself All non-empty text is truthy
Int 32 bit integer value Integer as a base 10 string All non-zero integers are truthy.
Float Floating point number Floating point value rendered to full precision. Very large or small values may use scientific notation. All floats that do not test equal to zero are truthy
Boolean Boolean value: values are specified using commands @true and @false "1" for true and "0" for false @true is truthy!
DateTime Representation of a date and time The ISO standard date string Always truthy
File Represents a file in the file system Full path to the file Always truthy
Directory Represents a directory in the file system Full path to the directory Always truthy
URL Represents a URL Complete URL Always truthy
Array Array of values of a single type Concatenation, comma separated, of the default text values of the array elements, surrounded by square brackets Truthy if at least one element is truthy.
OS Object describing the underlying operating system OS version Always truthy
Config Object giving access to program configuration Empty string (there's no one sensible default) Always truthy
Any Wraps any of the other data types. The default string of the wrapped data type. Truthy if the wrapped data type is truthy
Null A null object. Has no value or attributes. Empty string. Always falsey

The pseudo type Number is used in the documentation. It is used to mean either an Int or a Float.

A placeholder itself has type Text when rendered. Variables always return type Text. The return type of @ commands varies according to the command. See the command reference for details. The input and output types of filters depend on the filter. See the filter reference for details.

Various cast filters are provided for converting from some types to others. In the absence of any conversion filter the last command, variable or filter in a placeholder is converted to Text by its default text converter.

Clone this wiki locally