# Can you avoid using Base.invokelatest in this example?

**URL:** <https://discourse.julialang.org/t/can-you-avoid-using-base-invokelatest-in-this-example/33269>\
**Category:** General Usage\
**Created:** [January 12, 2020, 4:47pm UTC](https://discourse.julialang.org/t/can-you-avoid-using-base-invokelatest-in-this-example/33269 "2020-01-12T16:47:09Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![rvignolo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rvignolo/32/33498_2.png) [@rvignolo](https://discourse.julialang.org/u/rvignolo)\
**Post date:** [January 13, 2020, 3:49pm UTC](https://discourse.julialang.org/t/can-you-avoid-using-base-invokelatest-in-this-example/33269/21 "2020-01-13T15:49:44Z")

</div>

@stevengj thanks for your kind reply! They are really useful. I have further comments.

> [@stevengj](#):
>
> You could have the macro transform an expression like `a * b * c * μ * X` into `params.a * params.b * params.c * params.μ * X` — that is, unknown symbols `foo` used as arguments to function calls (etc.) are transformed into `params.foo` .

Yes, for me this was also a good approach, but I was not sure that all unknown symbols should be transformed to `params.symbol_name` in the general case (for the example I posted this is true). I mean, the provided expression `a * b * c * μ * X` could be really different and involve many things (I think I had previously think of an example where this was not true).

> [@stevengj](#):
>
> (either a named tuple or a `struct` )

Yes, everyting is prepared to run with named tuples or structs (using the same macro `@with_kw` in Parameters.jl).

I will think about this

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [July 24, 2022, 12:24am UTC](https://discourse.julialang.org/t/can-you-avoid-using-base-invokelatest-in-this-example/33269/22 "2022-07-24T00:24:22Z")

</div>

A post was split to a new topic: [How can a macro create functions that are handled at compile time?](https://discourse.julialang.org/t/how-can-a-macro-create-functions-that-are-handled-at-compile-time/84692)

[Previous page](https://discourse.julialang.org/t/can-you-avoid-using-base-invokelatest-in-this-example/33269.md?page=1)
