Allow get_env/2 and get_env/3 to accept not only key but also path (same as compile_env)

19 views
Skip to first unread message

Piotr Szmielew

unread,
Jan 27, 2020, 11:30:38 AM1/27/20
to elixir-lang-core
Hi,

In Elixir 1.10, there is a feature that allows you to specify compile_env. It's adorable, however, the calling is slightly different than on get_env.

Specifically second argument can be both key or key_path - which could cut a lot of fluff from traversing complicated trees of config in Elixir apps.

What do you think about it?

Piotr

Andrea Leopardi

unread,
Jan 27, 2020, 3:31:09 PM1/27/20
to elixir-l...@googlegroups.com
I am +1 on this. I think it's such a common functionality that this is worth it, it doesn't break APIs, and it suggests a generally widely used and common pattern.

Andrea

--
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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/8a370017-815f-4ea5-a288-c0c87489f775%40googlegroups.com.
--

Andrea Leopardi
Reply all
Reply to author
Forward
0 new messages