Each value in Red is of a specific datatype. Red values are strongly typed, but variables (words used to refer to values), are not. Values are the foundation of Red. Where most languages have 6-8 base datatypes, Red has almost 50. Many of these have unique, literal forms. There are some implementation details that, for the most part, you don’t need to worry about. For example, [native! action! function! routine!] are all types of functions, and you can use them without knowing the type.
To use Red effectively, you should become familiar with all the datatypes available.
-
-indicates no literal form for a value. These values must be created withmakeor with construction syntax (which is TBD for many types).
Type |
Literal Form |
Description |
|
Datatype "methods" in the Red internal OO model. |
|
|
Series of bytes. |
|
|
Array of bits used to store boolean values. |
|
|
Collections of data or code that can be evaluated at any point in time. |
|
|
Unicode code points. |
|
|
Valid types that are predefined for Red. |
|
|
Calendar dates, relying on the Gregorian calendar. |
|
Directly expressed email addresses. |
||
|
Specialized |
|
|
Object-like values that represent external activity. Effectively read-only. |
|
|
File names, or directory names and paths. |
|
|
64-bit positive or negative number that contains a decimal point. |
|
|
User-defined functions. |
|
|
Unevaluated |
|
|
Unevaluated |
|
|
Opaque integers used for interacting with the operating system. |
|
|
Block-like interface with fast lookups. |
|
|
Series of RGBA values that represent pixels in 2D images. |
|
|
32-bit numbers with no decimal point. |
|
|
Hashtags, keywords, and identifiers that do not contain spaces. |
|
|
Unevaluated (quoted) |
|
|
Unevaluated |
|
|
Boolean values. |
|
|
Associative array of key/value pairs. |
|
|
Amount of a specific (or generic) currency. |
|
|
External functions written in Red/System. |
|
|
Value that does not belong to any other datatype. Analogous to nil or nothing. |
|
|
Named or unnamed contexts that contain |
|
|
Infix function of two arguments. |
|
|
Two-dimensional coordinates. |
|
|
Immediately evaluated |
|
|
Series of values delimited by slashes |
|
|
Float values expressed as percentages. |
|
|
Denotes a reference by name. |
|
|
Symbolic values used as modifiers to functions or extensions to objects, files, urls, or paths. |
|
|
Function with a Red spec and Red/System body. |
|
|
Sets a "contextual reference" (word in a context, indexes slot in a series, or keyed reference in a series or map). |
|
|
Sets a reference to a value. |
|
|
Sequence of Unicode code points ( |
|
|
Markup language tags and elements. |
|
|
Directly expressed time values. Hours, minutes, seconds, and milliseconds. |
|
|
RGB and RGBA color values, ip addresses, and version numbers. Three to twelve positive integers separated by decimal points. |
|
|
Set, or collection, of predefined |
|
|
Single value that represents no usable value. |
|
https://www.red-lang.org, ftp://localhost |
Directly expressed Uniform Resource Locators. |
|
|
Ordered sequence of values of identical type ( |
|
|
Symbolic value that can be used like a variable. Identifier that refers to a value in a given context. |