> It doesn't quite apply to `Map.take/2` because the field may not be there anyway, so you can't easily pattern match, you always need a case. Right, but people might be using it on maps when knowing the keys are present (e.g. a struct) as well?
> I also see why we would add "delete!" but at the same time, "delete!" does not have much purpose. The result won't have said field anyway. Indeed, I cannot think of any actual use case for this one. But maybe drop! would be a bit similar? Maybe we could consider only introduce take! in this case, given the fact we already have pop! without having delete!. > So for now I would like to postpone adding this functionality. Sorry. No problem, I understand the concerns and implications :) Thank you for the discussion. Le lun. 25 oct. 2021 à 22:58, José Valim <jose.va...@dashbit.co> a écrit : > It doesn't quite apply to `Map.take/2` because the field may not be there > anyway, so you can't easily pattern match, you always need a case. > > I also see why we would add "delete!" but at the same time, "delete!" does > not have much purpose. The result won't have said field anyway. > > Now I am thinking it may be better to not add `Map.take!/2`. It is not > complicated to implement it yourself and given the possible confusion with > pattern matching and that it may require both drop! and delete!, it is > probably not worth it. So for now I would like to postpone adding this > functionality. Sorry. > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LZsHUBFkBH19w4-UNgApYuBAQj4K4vrhAu43NQz47%3D5g%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LZsHUBFkBH19w4-UNgApYuBAQj4K4vrhAu43NQz47%3D5g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CANnyohZQn6-WC8wpmT7F9qRvZo9m%3DQ1M4H7hpk2ry-c%3DK%2BBUJA%40mail.gmail.com.