-
-
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
RFC: lower a' as var"'"(a) #34634
RFC: lower a' as var"'"(a) #34634
Conversation
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt |
Doesn't seem like any of the failures were caused by this PR, so that's definitely a good sign! |
The implementation is correct. I think the main thing to do is decide whether we like this approach, and if so apply it consistently to this kind of syntax, and address it in the manual. |
This would mean https://github.com/simonster/TwoBasedIndexing.jl could make a comeback? Let's go! |
What's the point of letting a local name override a syntax? Overriding a global name in a local scope is certainly fine but this one seems to be all about syntax. If it was not about syntax then the user should have just picked a different function name instead, i.e. the user should just use It seems that the syntax customization can already be done by having a macro enclosing the part with customized syntax and the existing approach seems to be way clearer. |
Yes, but I can already write |
Right, that's fine and that's why I said.
|
Also, the bigger difference is that for builtin functions, they aren't much better names than user defined ones so while you can do However, the whole point of this change seems to be that people actually want to override this where the syntax was originally not overridable without using a macro. If no one actually want to use this to make a implicit syntax change then I'm certainly fine with that but in that case the lowering might as well not be changed. |
Making a distinction between |
Are you talking about applying this to every call, that currently gets lowered to a Base function, or would we draw a line somewhere? Out of the top of my head, I can think of |
If the argument is consistency, I'm certainly fine with lowering This however shouldn't be applied to other syntaxes, especially |
Thinking about it some more, I agree that lowering to |
There seems to be consensus, that it makes more sense to lower to |
Would it make sense to merge the docstrings for |
I agree that declaring I reviewed the translation table in lowering. I was somewhat surprised, but adjoint seems to be the only "clearly function-like" syntax we should apply this treatment to. |
Yes I think so. See the docstring for |
0a120a9
to
9b94ef3
Compare
I merged the two docstrings and added another example. I also thought, I'd add a sentence, that explains how |
I think this should be mostly done now. Or are there still issues that need to be addressed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I think this is a small improvement of consistency and it's worth doing.
I wasn't on the triage call though so I asked about it last week in
So I'm not sure whether triage was in favor of just merging this, only merging if unicode suffixes go ahead, or just ambivalent. |
Any news on this? |
Regarding
that can come later if we worry about it being breaking. As it stands, I'd argue that shadowing is good enough, i.e. allowing julia> let var"'" = transpose, v = rand(ComplexF64, 5)
v'v
end
1.6027508097762602 + 3.5821371834839146im |
Ok, fine, I guess I have a bit of a soft spot for local operators 😛 This can be rebased and merged. |
Co-Authored-By: Amin Yahyaabadi <[email protected]>
9b94ef3
to
f5762f7
Compare
Should be ready to merge now |
As proposed by @JeffBezanson in #33683, this changes the lowering of
a'
to__adjoint__(a)
var"'"(a)
, wherevar"'"
can be shadowed by the user. This should be less breaking than that PR, so could someone trigger PkgEval?