How to use `&` in a match expression?

In the Symbol and Operator Reference, a symbol is &used to:

Links: Matching Expressions

  • Computes the address of a mutable value to use when interacting with other languages.

  • Used in AND patterns.

I looked at the Match Expression page, but I did not see any AND patterns. How to use templates &?

+6
source share
1 answer

The syntax and pattern is as follows:

(a, b) & (_, "test")

This is documented here .

+5
source

Source: https://habr.com/ru/post/1016404/


All Articles