Re: [elixir-core:11662] Re: add Keyword.take!/2, Map.take!/2

2024-02-21 Thread sabi...@gmail.com
I’ve been thinking about this one for a while and I’m still a bit hesitant. Most of the time I wish for this I’m actually dealing with static keys, and despite being non-optimal the take syntax is much more compact than the pattern-matching version and has much less repetition: Enum.map(rows,

Re: [elixir-core:11660] Re: add Keyword.take!/2, Map.take!/2

2024-02-21 Thread José Valim
The previous discussion said: > 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

Re: [elixir-core:11659] Re: add Keyword.take!/2, Map.take!/2

2024-02-21 Thread Damir Petkovic
Thanks for sharing but I can't find where exactly it said it was rejected. Seems as if an incomplete discussion without a conclusion or am I missing something? On Wed, Feb 21, 2024 at 12:30 PM sabi...@gmail.com wrote: > For the record this proposal has been rejected once in the past >

Re: [elixir-core:11659] Re: add Keyword.take!/2, Map.take!/2

2024-02-21 Thread sabi...@gmail.com
For the record this proposal has been rejected once in the past https://groups.google.com/g/elixir-lang-core/c/cmirsH_OHKo/m/j2Um5uy-BgAJ Le mercredi 21 février 2024 à 20:21:56 UTC+9, José Valim a écrit : > +1 for the proposal, but it has to be implemented more efficiently than > what was

Re: [elixir-core:11658] Re: add Keyword.take!/2, Map.take!/2

2024-02-21 Thread DaTrader
@josevalim Can you provide a hint on how to do it more efficiently other than comparing the two lengths - just an idea or where to look to? On Wednesday, February 21, 2024 at 12:21:56 PM UTC+1 José Valim wrote: > +1 for the proposal, but it has to be implemented more efficiently than > what

Re: [elixir-core:11656] Re: add Keyword.take!/2, Map.take!/2

2024-02-21 Thread José Valim
+1 for the proposal, but it has to be implemented more efficiently than what was described here and we also need to add drop!. PRs welcome. On Wed, Feb 21, 2024 at 10:59 AM Artur Plysiuk wrote: > I just came here to add the same proposal. > > четвер, 28 грудня 2023 р. о 11:40:07 UTC+2 DaTrader

[elixir-core:11656] Re: add Keyword.take!/2, Map.take!/2

2024-02-21 Thread Artur Plysiuk
I just came here to add the same proposal. четвер, 28 грудня 2023 р. о 11:40:07 UTC+2 DaTrader пише: > It's not special at all. Actually it is as generic as the current > `Keyword.take/2`. You either want the operation to succeed if there aren't > all keys present or you want it to fail. Those