Skip to content
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

reflection: support additional call syntaxes for @invoke[latest] #47705

Merged
merged 1 commit into from
Nov 29, 2022

Conversation

aviatesk
Copy link
Member

Like @invoke (xs::Xs)[i::I] = v::V and @invokelatest x.f = v.

base/reflection.jl Outdated Show resolved Hide resolved
elseif isexpr(ex, :.) # `x.f`
f = GlobalRef(mod, :getproperty)
args = flatten(ex.args)
elseif isexpr(ex, :ref) # `x[i]`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have code like this to support the code_* macros. Can we avoid duplicating work here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we probably want to factor out destructure_callex with

function gen_call_with_extracted_types(__module__, fcn, ex0, kws=Expr[])

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But maybe with a separate PR.

base/reflection.jl Outdated Show resolved Hide resolved
@aviatesk
Copy link
Member Author

Let me merge this once CI is green, and work on the refactoring that Keno suggested in this comment in a separate PR.

@aviatesk aviatesk added the merge me PR is reviewed. Merge when all tests are passing label Nov 28, 2022
base/reflection.jl Outdated Show resolved Hide resolved
base/reflection.jl Outdated Show resolved Hide resolved
Like `@invoke (xs::Xs)[i::I] = v::V` and `@invokelatest x.f = v`.

Co-Authored-By: Jameson Nash <[email protected]>
@aviatesk aviatesk merged commit 4fd26ba into master Nov 29, 2022
@aviatesk aviatesk deleted the avi/at-invokes branch November 29, 2022 04:19
@DilumAluthge DilumAluthge removed the merge me PR is reviewed. Merge when all tests are passing label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants