-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow operator suffixes to the postfix apostrophe #28494
Comments
I believe that it would be possible to shoehorn in a In other contexts, one would need something convoluted like |
Should be fixed by #37247 |
Closed by #37247 |
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 makeA'ᵀ
the transpose ofA
.See #21037 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 likeapostrophe
can lead to problems similar to #25947. That problem can be avoided by mapping toBase.apostrophe
instead of using the local scope.The text was updated successfully, but these errors were encountered: