A language built for fun
This project is maintained by cometlang
inherits Iterable
Not intended to be instantiated directly, but rather through the enum NAME {}
syntax
add(name, value)
adds a value to the enum with the given name string and number valuelength()
returns the number of values in the enumcontains?(value)
returns true
if the given EnumValue is part of this enumparse(value)
parses either an enum name, or an integer to the corresponding EnumValue. Returns nil
if no corresponding EnumValue could be found in this enum.inherits Number
Not intended to be instantiated directly.
Acts like a number, because that’s pretty useful in an enum value, but has a couple of extra methods / fields.
EnumValue(name, value)
sets the corresponding fields name and value, along with initialising the numbername
returns the String representing the enum namevalue
returns the Number representing the enum valueto_string()
returns a string of the form [name]:[value]
, e.g. my_enum_value:64