# pan enums like zig, enums are based around an *integer* but i've never seen an enum based on *another enum* .. example: ascii subsets: - latin_lower a-z - latin_upper A-Z - latin a-z, A-Z - decimal 0-9 - hex 0-9,a-f - base64 - .. common semantic enum ancestor utility function for common names - NUL, null - BEL, bell - BS, backspace - NL, newline - CR, carriage_return - HT, horizontal_tab - ESC - DEL lang-native nil as 128 all inside the stdlib; not language/compiler-blessed, not a special-case // https://dirtand.rocks/ascii.html const Ascii = enum( u8 ) { .@"\x00", .@"\x01", .@"\x02", .@"\x03", .@"\x04", .@"\x05", .@"\x06", .@"\x07", .@"\x08", .@"\x09", .@"\x0a", .@"\x0b", .@"\x0c", .@"\x0d", .@"\x0e", .@"\x0f", .@"\x10", .@"\x11", .@"\x12", .@"\x13", .@"\x14", .@"\x15", .@"\x16", .@"\x17", .@"\x18", .@"\x19", .@"\x1a", .@"\x1b", .@"\x1c", .@"\x1d", .@"\x1e", .@"\x1f", .@" ", .@"!", .@"\"", .@"#", .@"$", .@"%", .@"&", .@"'", .@"(", .@")", .@"*", .@"+", .@",", .@"-", .@".", .@"/", .@"0", .@"1", .@"2", .@"3", .@"4", .@"5", .@"6", .@"7", .@"8", .@"9", .@":", .@";", .@"<", .@"=", .@">", .@"?", .@".@", .@"A", .@"B", .@"C", .@"D", .@"E", .@"F", .@"G", .@"H", .@"I", .@"J", .@"K", .@"L", .@"M", .@"N", .@"O", .@"P", .@"Q", .@"R", .@"S", .@"T", .@"U", .@"V", .@"W", .@"X", .@"Y", .@"Z", .@"[", .@"\\", .@"]", .@"^", .@"_", .@"`", .@"a", .@"b", .@"c", .@"d", .@"e", .@"f", .@"g", .@"h", .@"i", .@"j", .@"k", .@"l", .@"m", .@"n", .@"o", .@"p", .@"q", .@"r", .@"s", .@"t", .@"u", .@"v", .@"w", .@"x", .@"y", .@"z", .@"{", .@"|", .@"}", .@"~", .nil = 128, pub var# Name = enum { .NUL , .SOH , .STX , .ETX , .EOT , .ENQ , .ACK , .BEL , .BS , .HT , .LF , .VT , .FF , .CR , .SO , .SI , .DLE , .DC1 , .DC2 , .DC3 , .DC4 , .NAK , .SYN , .ETB , .CAN , .EM , .SUB , .ESC , .FS , .GS , .RS , .US , pub var# util = fn | name :Name | :Ascii { switch( name ) case( .NUL ) { .@"\x00" } case( .SOH ) { .@"\x01" } case( .STX ) { .@"\x02" } case( .ETX ) { .@"\x03" } case( .EOT ) { .@"\x04" } case( .ENQ ) { .@"\x05" } case( .ACK ) { .@"\x06" } case( .BEL ) { .@"\x07" } case( .BS ) { .@"\x08" } case( .HT ) { .@"\x09" } case( .LF ) { .@"\x0a" } case( .VT ) { .@"\x0b" } case( .FF ) { .@"\x0c" } case( .CR ) { .@"\x0d" } case( .SO ) { .@"\x0e" } case( .SI ) { .@"\x0f" } case( .DLE ) { .@"\x10" } case( .DC1 ) { .@"\x11" } case( .DC2 ) { .@"\x12" } case( .DC3 ) { .@"\x13" } case( .DC4 ) { .@"\x14" } case( .NAK ) { .@"\x15" } case( .SYN ) { .@"\x16" } case( .ETB ) { .@"\x17" } case( .CAN ) { .@"\x18" } case( .EM ) { .@"\x19" } case( .SUB ) { .@"\x1a" } case( .ESC ) { .@"\x1b" } case( .FS ) { .@"\x1c" } case( .GS ) { .@"\x1d" } case( .RS ) { .@"\x1e" } case( .US ) { .@"\x1f" } case( .DEL ) { .@"\x7f" } }; }; }; pub Latin = enum( Ascii ) { .A, .B, .C, .D, .E, .F, .G, .H, .I, .J, .K, .L, .M, .N, .O, .P, .Q, .R, .S, .T, .U, .V, .W, .X, .Y, .Z, .a, .b, .c, .d, .e, .f, .g, .h, .i, .j, .k, .l, .m, .n, .o, .p, .q, .r, .s, .t, .u, .v, .w, .x, .y, .z, }; pub LatinLower = enum( Latin ) { .a, .b, .c, .d, .e, .f, .g, .h, .i, .j, .k, .l, .m, .n, .o, .p, .q, .r, .s, .t, .u, .v, .w, .x, .y, .z, }; pub LatinUpper = enum( Latin ) { .A, .B, .C, .D, .E, .F, .G, .H, .I, .J, .K, .L, .M, .N, .O, .P, .Q, .R, .S, .T, .U, .V, .W, .X, .Y, .Z, };