That's not entirely accurate. In my case I was using a series of pipes so I
did not have access to the map. My case might be very niche, though.

On Mon, Mar 20, 2017, 12:44 AM José Valim <[email protected]>
wrote:

> The reason why get_lazy does not pass the map is because you already have
> the map, since you pass it as first argument.
>
> On Mon, Mar 20, 2017 at 03:44 David Long <[email protected]> wrote:
>
> I was working on some code that would simply test if one key was in a map
> and return it's value, and otherwise return a different key's value.
>
> The map had a form like the following:
>
> %{
>   oncall: "dlong",
>   overrideoncall: "jsmith",
>   ...
> }
>
>
> If there was someone overriding on call then their name would be in the `
> overrideoncall` key, otherwise the key would not be in the map.
>
> I think this could be a nice use for `Map.get_lazy`, if the function had
> the original map passed in, allowing me to write the code as follows:
>
> Map.get_lazy(on_call_group, :overrideoncall, &(&1[:oncall]))
>
>
> Before I wrote a pull request, I thought I'd see if this is a feature that
> makes sense to others?
>
> --
>
> 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/719dc4fc-ae23-4437-b059-d91356e9b43b%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/719dc4fc-ae23-4437-b059-d91356e9b43b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
>
>
> *José Valim*
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R&D
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "elixir-lang-core" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/elixir-lang-core/JuAZnOXpo5Q/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J7dZWROSBnBU7Ayn%3DhQGphp_ciFZTRf83XscDTQQ2z3w%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J7dZWROSBnBU7Ayn%3DhQGphp_ciFZTRf83XscDTQQ2z3w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAPkhLiQBo-HK38-UdEh%3DgtiFH%2BsrGeBk06ps7JqB7KMtkQK6cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to