Skip to content

Strongly typed Axis arguments #91

Closed

Description

@bluss

We could have strongly typed Axis arguments (instead of current usize).

It even allows mixing dynamically bounds checked axis numbers and statically checked ones:

.subview(Axis(0), 1) vs. .subview(Axis0, 1) would both be possible at the same time.

Activity

  1. vbarrielle commented on Feb 28, 2016

    @vbarrielle
    Contributor

    Yes that's really a nice feature to have, imo it improves readability and prevents some mistakes. Axis0 would be exposed as a constant?

  2. bluss commented on Feb 28, 2016

    @bluss
    MemberAuthor

    Yes. Using generics is unfortunate in one way, since it makes the interface seem more complicated. But it also enables static checking. I've tested this out at some point, and I think it works.

  3. bluss commented on Feb 28, 2016

    @bluss
    MemberAuthor

    Oh I think it requires O(n²) impl blocks where n is the number of dimensions supported though (We have up to 12-tuples).

  4. vbarrielle commented on Feb 28, 2016

    @vbarrielle
    Contributor

    Maybe macros can help on that point, but I wouldn't know, I've not written many macros yet.

  5. bluss commented on Feb 29, 2016

    @bluss
    MemberAuthor

    Fixed by #97

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions