Skip to content

replace inline keyword for while and for loops with unroll #2805

@Sahnvour

Description

@Sahnvour

Naïvely, I thought unroll might be a better keyword and @andrewrk said he considered it before, but went for inline as it's well-known.

I don't have a strong opinion, but still think unroll better expresses the intent.

unroll

Pros:

  • that's the specific term for what the feature is doing

Cons:

  • it might cause some confusion in that it doesn't unroll loops on runtime-known iterator (minor)

inline

Pros:

  • that's an usual keyword

Cons:

  • it otherwise has a single meaning in zig, which to me is quite different (I didn't go through all keywords, but that's probably a good rule of thumb to have a unique meaning for each keyword ?)
  • for people coming from c, c++ and maybe other languages, it might not be clear that in zig inline is solely used for inlining functions and is more than a suggestion (minor)

Other propositions ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions