Skip to content

"Pattern matching friendly" #1

@bluss

Description

@bluss

/// Convert the dimension into a pattern matching friendly value.

Sorry for starting with a comment on the "least important".

Once upon a time, Rust could do patterns with tuples but not with arrays:

let (x, y) = obj1;  // OK
let [x, y] = obj2;  // used to be invalid syntax.

But this is no longer the case. Both (x, y) and [x, y] are valid patterns since "some" time (for pairs and arrays-of-2 respectively). So this was the origin of "pattern matching friendly" for tuples here.

With that said, patterned/as_pattern probably still plays a role when we grow the number of ways to specify layout, for example when const length axes are in play?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions