# Invoke a method

**URL:** <https://discourse.julialang.org/t/invoke-a-method/1275>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 4, 2017, 11:44am UTC](https://discourse.julialang.org/t/invoke-a-method/1275 "2017-01-04T11:44:10Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 5, 2017, 9:22am UTC](https://discourse.julialang.org/t/invoke-a-method/1275/10 "2017-01-05T09:22:07Z")

</div>

@StefanKarpinski @jameson Thanks for the pointers. While I don’t doubt that first-class methods would be useful in some applications, in my particular use case I decided that they would be a very convoluted and unidiomatic solution.

What I wanted to do is basically the following: have a `DataFrame`-like object which is basically a `Dict{Symbol,Vector}`. I was looking for a way to map vectors using user provided functions, and looking up the vectors dynamically. For example, suppose the user supplies a function `f(b,a)`. The map function would look up `:a` and `:b` in the `Dict`, assign them to positions `2` and `1`, and call broadcast with `f` and the vectors in the right place. I asked about [argument name extraction](https://discourse.julialang.org/t/extract-argument-names/862/2) here. The inspiration was [Mamba’s implementation](https://github.com/brian-j-smith/Mamba.jl/blob/master/src/utils.jl#L15) of this.

I am currently of the opinion that this is unnatural in Julia, since each function can have many methods, so I could have multiple matches. I could of course apply some kind of dispatch machinery to select the “most specific” one based on the type signature, but in the end I concluded that this is confusing and error-prone, and the [DataFramesMeta.@with](https://github.com/JuliaStats/DataFramesMeta.jl/blob/master/src/DataFramesMeta.jl#L20) is a much more natural solution.

---

_[View the full topic](https://discourse.julialang.org/t/invoke-a-method/1275)._
