# How do you invoke a method (like a specific method, not a function)?\`\`\`julia&gt;

**URL:** <https://discourse.julialang.org/t/how-do-you-invoke-a-method-like-a-specific-method-not-a-function-julia-gt/54605>\
**Category:** General Usage\
**Created:** [February 4, 2021, 10:18am UTC](https://discourse.julialang.org/t/how-do-you-invoke-a-method-like-a-specific-method-not-a-function-julia-gt/54605 "2021-02-04T10:18:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 4, 2021, 10:18am UTC](https://discourse.julialang.org/t/how-do-you-invoke-a-method-like-a-specific-method-not-a-function-julia-gt/54605/1 "2021-02-04T10:18:25Z")

</div>

How do you invoke a method (like a specific method, not a function)?

```julia
julia&gt; func(a) =5
func (generic function with 1 method)

julia&gt; meth = first(methods(func))
func(a) in Main at REPL[83]:1

julia&gt; meth(1)
ERROR: MethodError: objects of type Method are not callable
Stacktrace:
 [1] top-level scope
   @ REPL[85]:1
 [2] eval
   @ .\boot.jl:360 [inlined]

```

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1612433881045600?thread_ts=1612433881.045600&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![heetbeet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heetbeet/32/20958_2.png) [@heetbeet](https://discourse.julialang.org/u/heetbeet)\
**Post date:** [February 4, 2021, 10:45am UTC](https://discourse.julialang.org/t/how-do-you-invoke-a-method-like-a-specific-method-not-a-function-julia-gt/54605/2 "2021-02-04T10:45:12Z")

</div>

![](https://global.discourse-cdn.com/julialang/original/3X/c/d/cd74ef987e4336867cb3b43a6a55b89c6d8cfb21.png)

[Avik Sengupta](https://app.slack.com/team/U679VPJ8L) [20 minutes ago](https://julialang.slack.com/archives/C6A044SQH/p1612434275046200?thread_ts=1612433881.045600&cid=C6A044SQH)

`invoke(func, Tuple{Int}, 5)`

![](https://global.discourse-cdn.com/julialang/original/3X/9/7/9705e018bf090236353754c40032380d51c677c5.jpeg)

[Sebastian Pfitzner](https://app.slack.com/team/U6BNE7LTZ) [15 minutes ago](https://julialang.slack.com/archives/C6A044SQH/p1612434590046400?thread_ts=1612433881.045600&cid=C6A044SQH)

aka `invoke(first(meth.sig.parameters).instance, Tuple{meth.sig.parameters[2:end]...}, 5)` (edited)

![](https://global.discourse-cdn.com/julialang/original/3X/5/a/5aad322befa8f6e2f9a162ed7c1cffdcfbbea85d.jpeg)

[Heetbeet](https://app.slack.com/team/U018FJVBXPD) [2 minutes ago](https://julialang.slack.com/archives/C6A044SQH/p1612435358046700?thread_ts=1612433881.045600&cid=C6A044SQH)

Ah okay, or in that case also

`(first(meth.sig.parameters).instance)(5)`

![](https://global.discourse-cdn.com/julialang/original/3X/5/a/5aad322befa8f6e2f9a162ed7c1cffdcfbbea85d.jpeg)

[Heetbeet](https://app.slack.com/team/U018FJVBXPD) [2 minutes ago](https://julialang.slack.com/archives/C6A044SQH/p1612435366046900?thread_ts=1612433881.045600&cid=C6A044SQH)

Thanks

![](https://global.discourse-cdn.com/julialang/original/3X/9/7/9705e018bf090236353754c40032380d51c677c5.jpeg)

[Sebastian Pfitzner](https://app.slack.com/team/U6BNE7LTZ) [1 minute ago](https://julialang.slack.com/archives/C6A044SQH/p1612435405047100?thread_ts=1612433881.045600&cid=C6A044SQH)

Right. Don’t rely on that working though, it’s not a public API

![](https://global.discourse-cdn.com/julialang/original/3X/5/a/5aad322befa8f6e2f9a162ed7c1cffdcfbbea85d.jpeg)

[Heetbeet](https://app.slack.com/team/U018FJVBXPD) [\< 1 minute ago](https://julialang.slack.com/archives/C6A044SQH/p1612435483047300?thread_ts=1612433881.045600&cid=C6A044SQH)

Okay, will keep it as a toy only
