# enum · Rell standard library · Chromia Docs (concept)

> hidden abstract type enum An enum is a set of member constants who share a type. The declaration enum example { A, B, C } defines a type example , with thr

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/enum/

TYPE

# enum

```signature
hidden abstract type enum
```

An enum is a set of member constants who share a type.

The declaration `enum example { A, B, C }` defines a type `example`, with three member constants,
`example.A`, `example.B` and `example.C`.

Enum names and member constant names follow the same rules as all identifiers in Rell. However, by
convention, enum names use `snake_case`, and member constants use `UPPER_SNAKE_CASE`.

Examples:

* `enum primary_color { RED, BLUE, GREEN }`
* `enum error { TIMEOUT, MALFORMED_RESPONSE, NOT_FOUND, UNAUTHORIZED, UNKNOWN }`
* `enum cardinal_direction { NORTH, EAST, SOUTH, WEST }`

Since 0.7.0

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/enum/index.html)Generated API reference, mirrored from the live docs
