# Runtime-calculated default values for structs

**URL:** <https://forum.elixirforum.com/t/runtime-calculated-default-values-for-structs/73189>\
**Category:** Proposals: Ideas\
**Tags:** ecto, structs, oban, default\
**Created:** [November 4, 2025, 3:57pm UTC](https://forum.elixirforum.com/t/runtime-calculated-default-values-for-structs/73189 "2025-11-04T15:57:26Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![ffloyd](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/ffloyd/32/10538_2.png) [@ffloyd](https://forum.elixirforum.com/u/ffloyd)\
**Post date:** [November 4, 2025, 9:02pm UTC](https://forum.elixirforum.com/t/runtime-calculated-default-values-for-structs/73189/15 "2025-11-04T21:02:59Z")

</div>

> [@mudasobwa](#):
>
> how would you expect dependencies to automagically convert to support dynamic defaults, let alone it might break them.

For example `Estructura`. With my current proposal I would just use it with `defdynstruct`. It still generates ` __schema__ ` functions, etc. I expect all the features of `Estructura` to just work. Am I right or it somehow relies on `%A{} == %A{}`? (that’s the only promise that is broken by `defdynstruct`).

> [@mudasobwa](#):
>
> I would typically comment out the declaration of the struct, collect all compilation errors, and fix them one by one.

Is it adequate price for introducing dynamic default?

---

_[View the full topic](https://forum.elixirforum.com/t/runtime-calculated-default-values-for-structs/73189)._
