Skip to content

declaration_naming can type factories be a namespace? #83

@KurtWagner

Description

@KurtWagner

Currently in zig this is detected as a problem as the structure being returned has no fields with data (just methods) so it's considered a namespace and should be snake_case:

error Namespace declaration should be snake_case [lib/std/crypto/salsa20.zig:17:11] declaration_naming

 17 | pub const Salsa20 = Salsa(20);
    |           ^^^^^^^

The thing is though that the argument is used in the return type, which means it's kinda instantiated but at comp time (e.g., Salsa(10) != Salsa(11)). The result is can not be instantiated (i.e., namespace)

So should it be TitleCase like other types or remain as a namespace snake_case? I'm leaning to the latter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions