I agree this is an issue although I don't have any solution in mind.
Proposals are welcome.



*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

On Thu, Dec 8, 2016 at 12:50 AM, Michał Muskała <[email protected]> wrote:

> Good evening everybody.
>
> This is a moved discussion from https://github.com/elixir-
> lang/elixir/issues/5548#issuecomment-265602755.
>
> Today, there's no way to work with structs in an easy way for the _in
> functions.
>
> For static keys, everything is nice and shiny when working with both maps
> and structs:
>
>     update_in(foo.bar.buz, &(...))
>
> Unfortunately as soon as we need to introduce a dynamic value, it suddenly
> becomes extremely clunky in case of structs:
>
>     update_in(foo.bar[key], &(...))
>     # vs
>     update_in(foo, [Access.key!(:bar), Access.key(key)], &(...))
>
> This is generally pushing me to work more with unstructured data in forms
> of maps, the usability difference is huge. The Access is a very powerful
> tool that helps to solve many problems in a concise way, it's unfortunate
> structs have such a poor support.
>
> Michał.
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/4299E5C9-9C9B-411F-90FA-9EF7B6900327%40muskala.eu.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JBZ7JpaBBcP_9sAnOrCwLAn0rwDO5kqUawpTHtBcWTgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to