-
Notifications
You must be signed in to change notification settings - Fork 0
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 specific type. Each parameter passed to a command or filter has a data type.
The supported types are given in the following table. Each type has a default string representation and exposes a constructor that can be called using the @construct
command.
All data types are immutable.
Types not yet implemented are marked with a ⛔ symbol.
Type | Description | Default string | Truthiness | Constructor Parameters☆ |
---|---|---|---|---|
Text ⛔ | Plain text strings | The text itself | All non-empty text is truthy | (1) String literal. (2) Instance of any data type: the default string is copied. |
Int ⛔ | 32 bit integer | The integer as a base 10 string | All non-zero integers are truthy. | Integer literal. |
Float ⛔ | Floating point number | The 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 | (1) Floating point literal. (2) Integer literal or Int instance. |
Boolean ⛔ | Boolean value: values are specified using commands @true and @false
|
"1" for true and "0" for false |
@true is truthy! |
(1) @true , (2) @false (3) Instance of any data type: data type's truthiness is used. |
DateTime ⛔ | Representation of a date and time | The ISO standard date string | Always truthy | (1) Integer literal or Int object parameters representing, in order, Year, Month, Day, Hour(⊙), Minute(⊙), Second(⊙), Millisecond(⊙). Parameters marked ⊙ are optional and default to 0. (2) string literal or Text object containing valid ISO 8601 date. |
File ⛔ | Represents a file in the file system | Full path to the file | Always truthy | (1) String literal or Text object containing full or relative path to the file. (2) Directory object specifying file's directory, folliwed by string literal or Text object containing file name. |
Directory ⛔ | Represents a directory in the file system | Full path to the directory | Always truthy | String literal or Text object containing full or relative directory path. |
URL ⛔ | Represents a URL | Complete URL | Always truthy | String literal or Text object containing complete URL. |
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 iff at least one element is truthy. | A parameter, of array element type, for each array element. |
OS ⛔ | Object describing the underlying operating system | OS version | Always truthy | None. |
Any ⛔ | Wraps any of the other data types. | The default string of the wrapped data type. | Truthy iff the wrapped data type is truthy | An instance of data type to be wrapped. |
Null ⛔ | A null object. Has no value or attributes. | Empty string. | Always falsey | None. |
☆ In addition to the constructor parameters listed in the table above, all data types have a copy constructor that takes an instance of the data type and creates a copy of it.
@os
or @null
respectively creates the appropriate singleton instance. Subsequent calls to @os
and @null
simply return the same instance.
🗒️ The pseudo type Number is used in the documentation. It is used to mean either an Int or a Float.
A placeholder itself has the type of the output of the last filter, or of the source if there are no filters, or Null if the ;
output suppression operator was used. When a top level placeholder is rendered the data it returns is converted to text using the data type's default string representation.
Variables take the type of the value assigned to them.
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.