Allow operator suffixes to the postfix apostrophe #28494
Description
Since #22089 it is possible to add suffixes to existing binary operators in order to create entirely new ones.
If it were possible to add suffixes to the postfix '
operator as well, then that would make it possible for the user to create an arbitrary number of new postfix operators. For example, it would make it possible to make A'ᵀ
the transpose of A
.
See JuliaLang/LinearAlgebra.jl#410 for the beginning of this discussion. Here's a brief summary as best as I've understood: The original proposal was to map x'
to the function call '(x)
, and then allow suffixes on that function name, but this is not possible. The first character of an identifier cannot be '
, because '
is already used to introduce character literals. On the other hand, using a function name like apostrophe
can lead to problems similar to #25947. That problem can be avoided by mapping to Base.apostrophe
instead of using the local scope.
Activity