• Knusper@feddit.de
    link
    fedilink
    arrow-up
    1
    ·
    11 months ago

    No, not at all. It’s a joke post, abusing the in-memory representation of the Option type to construct numbers. When nesting the Option type, it turns into a densely packed bit vector…

    And if I understand the purpose of Fin correctly, you’re picking on the one ‘peasant language’ that actually has something like that built-in.
    In Rust, you can specify the type of an array as e.g [u8; 3]. Which is an array containing values of type u8 (unsigned 8-bit integer) with a fixed, compile-time-guaranteed length of 3. So, [u8; 3] could be used to represent an RGB color, for example.
    It is an array, not a set, but well, close enough.