set_enum

Creates a new enumerator type.

This function generates a change.

Function

set_enum(enum, members)

Arguments

Argument Type Description
enum str The name of the enumerator type to create.
members thing Thing containing all the members to be set (or enum methods).

Return value

The value nil.

Example

This code shows how to use set_enum():

set_enum('Status', {
    OK: 0,
    NOK: -1,
    isOk: |this| this == Status{OK},
});

Return value in JSON format

null