wiki:olivine/dsl/types/core

Version 2 (modified by jonathan, 4 years ago) (diff)

Introduce reals, rename "whole number" to "integer"

Core Types in Olivine

text

Text is just that, text. You string a line of characters together and wrap them in a pair of double-quotes. In fact, in most languages this type is called string. Here is an example of text:

"Hello World!"

integer

Integers are whole numbers, they are numbers without fractions. They can be positive or negative but cannot have a decimal point. For example, the most important whole number in all of the universe is:

42

real

Reals are rational numbers, they are numbers that may have decimal points. They can be positive or negative and although are compatible with whole number values you must always specify a decimal point to explicitly express a real value. Here are examples of reals (for reals!):

42.0

7.8

-23.82

list

A list is a type that contains multiple instances of some other type. All the items in the list must be the same type. Here is a list of text for example:

[
   "First item"
   "Second item"
   "Third item"
]

Lists can also be expressed on a single line using a comma separator, for example:

[ "First item", "Second item", "Third item" ]