Skip to content

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

Merged
aviatesk merged 1 commit intomasterfrom
avi/at-invokes
Nov 29, 2022
Merged

reflection: support additional call syntaxes for @invoke[latest]#47705
aviatesk merged 1 commit intomasterfrom
avi/at-invokes

Conversation

@aviatesk
Copy link
Member

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

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.

@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
Like `@invoke (xs::Xs)[i::I] = v::V` and `@invokelatest x.f = v`.

Co-Authored-By: Jameson Nash <vtjnash@gmail.com>
@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