Course of Raku / Advanced / More about built-in types
Enumerations 🆕
An enumeration (an enum) is a type whose values are
a fixed set of named constants — the days of the week, the colours of a
traffic light, the suits in a deck of cards. Instead of remembering that
0 means red and 1 means amber, you give each
value a name and let Raku keep track of the numbers.
This section shows how to define an enum and how to move between its names and the values behind them.
Topics in this section
Practice
Complete the quizzes that cover the contents of this section.
Exercises
This section contains 3 exercises. Examine all the topics of this section before doing the coding practice.