# Nested struct or something else?

**URL:** <https://discourse.julialang.org/t/nested-struct-or-something-else/51604>\
**Category:** New to Julia\
**Created:** [December 10, 2020, 1:00pm UTC](https://discourse.julialang.org/t/nested-struct-or-something-else/51604 "2020-12-10T13:00:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [December 10, 2020, 2:37pm UTC](https://discourse.julialang.org/t/nested-struct-or-something-else/51604/2 "2020-12-10T14:37:02Z")

</div>

> [@mocalvao](#):
>
> **Question 2:** Should I explicitly indicate the type for `m` ? For me, it seems to help legibility a bit, but I wonder about performance…

That won’t affect performance. It might be useful to debug the code.

Concerning the general question, maybe this thread helps, particularly what I have marked as a solution to it, which is the possibility of writing function-like objects. The types of structures of objects and functions to achieve what you want are all there, I think: [Define data-dependent function, various ways](https://discourse.julialang.org/t/define-data-dependent-function-various-ways/48988)

---

_[View the full topic](https://discourse.julialang.org/t/nested-struct-or-something-else/51604)._
