# Function generation / dynamic dispatch

**URL:** <https://forum.elixirforum.com/t/function-generation-dynamic-dispatch/13325>\
**Category:** Questions\
**Tags:** macros, behaviours\
**Created:** [March 27, 2018, 12:59am UTC](https://forum.elixirforum.com/t/function-generation-dynamic-dispatch/13325 "2018-03-27T00:59:46Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![OvermindDL1](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/overminddl1/32/2677_2.png) [@OvermindDL1](https://forum.elixirforum.com/u/OvermindDL1)\
**Post date:** [March 27, 2018, 8:07pm UTC](https://forum.elixirforum.com/t/function-generation-dynamic-dispatch/13325/9 "2018-03-27T20:07:01Z")

</div>

> [@Ripster](#):
>
> If I was able to get every module that has use Packet, header: 1 or implements a Packet behaviour, or every module with a @packet\_header attribute, then I could build the list without having to list them all out manually.

I really should release my library of mine that does that at compile-time… \>.\>

Hmm, actually you could use my [ProtocolEx](http://hex.pm/packages/protocol_ex) (it’s like the Protocol Library built into elixir, except it is based on matchers and guards instead of types, and has the ability to be faster too by inlining and more) library if you don’t mind putting your `parse` functions in implementation modules (you can of course put multiples of the parse functions in a single implementation if you want, so you can group like-functionality. 🙂

---

_[View the full topic](https://forum.elixirforum.com/t/function-generation-dynamic-dispatch/13325)._
