Proposal: Map.only and Map.except (Map.take and Enum.take are pretty different but named the same)

32 views
Skip to first unread message

he...@ryanwinchester.ca

unread,
Aug 23, 2018, 2:37:22 PM8/23/18
to elixir-lang-core
I keep forgetting Map.take because Enum.take is so different and I usually look at Enum docs for functions before Map or List.

I think it would be nice if Map had Map.only(map,keys) and Map.except(map, keys). They could start off by just being an alias for take and drop?

I guess ithe same should apply to Keyword as well.

Thanks

José Valim

unread,
Aug 23, 2018, 2:39:44 PM8/23/18
to elixir-l...@googlegroups.com
Thanks Ryan,

Note though we don't have "function aliases" in Elixir and I don't think the pros here outweighs the potential confusion of having two functions that do exactly the same thing. :)



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
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-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/db2a34a3-a9c9-4e4d-98dd-3ab3fbc7341d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

he...@ryanwinchester.ca

unread,
Aug 23, 2018, 2:58:13 PM8/23/18
to elixir-lang-core
Yeah,

I was expecting that response but thought I'd ask anyway on the small chance my dreams would come true 🤣.



On Thursday, August 23, 2018 at 11:39:44 AM UTC-7, José Valim wrote:
Thanks Ryan,

Note though we don't have "function aliases" in Elixir and I don't think the pros here outweighs the potential confusion of having two functions that do exactly the same thing. :)



José Valim
Skype: jv.ptec
Founder and Director of R&D

On Thu, Aug 23, 2018 at 8:37 PM, <he...@ryanwinchester.ca> wrote:
I keep forgetting Map.take because Enum.take is so different and I usually look at Enum docs for functions before Map or List.

I think it would be nice if Map had Map.only(map,keys) and Map.except(map, keys). They could start off by just being an alias for take and drop?

I guess ithe same should apply to Keyword as well.

Thanks

--
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.
Reply all
Reply to author
Forward
0 new messages