Hi

Am 2025-12-10 14:37, schrieb Vinicius Dias:
This particular syntax was chosen as it is the same as in Ruby, the only other language we know of that has this functionality.

I don't know how helpful this info is, but I'll provide it anyway.
Elixir and Erlang also have the functionality and its syntax is the
same, using the ^ character.

https://hexdocs.pm/elixir/pattern-matching.html#the-pin-operator

AFAICT this is not quite right. It is supported in Elixir, but not in Erlang. There is a proposal to add it to Erlang, but the corresponding PR is still open, which indicates that it is not accepted yet: https://www.erlang.org/eeps/eep-0055

It's not surprising to me that Elixir supports it, since Elixir is heavily inspired / influenced by Ruby.

Best regards
Tim Düsterhus

Reply via email to