1.2 Simple Data🔗ℹ

Shplait supports various kinds of integers, all with type Int:

> 1

- Int

1

> -42

- Int

-42

> 1_000_000

- Int

1000000

The full syntax of numbers is probably not important, but it’s shrubbery number syntax restricted to integers.

The booleans true and false are written #true and #false:

> #true

- Boolean

#true

> #false

- Boolean

#false

Strings are written the usual way with a starting and ending ":

> "apple"

- String

"apple"

> "banana cream pie"

- String

"banana cream pie"

> "yes, \"escape\" quotes with backslash"

- String

"yes, \"escape\" quotes with backslash"

In addition to strings, Shplait includes string-like values called symbols. A symbol is written with a hash and single quote #' followed by a sequence of characters that are allowed in identifiers (which does not include whitespace or operator characters).

> #'apple

- Symbol

#'apple

> #'banana

- Symbol

#'banana

> #'a_to_b

- Symbol

#'a_to_b

Characters like -, >, and ? are not only allowed in operator names.

Individual characters are infrequently used in Shplait, and they do not have a convenient syntax, but they can be written with #\ inside #{}:

> #{#\a}

- Char

#{#\a}

> #{#\A}

- Char

#{#\A}

> #{#\space} // same as #\ followed by a space

- Char

#{#\space}