You wouldn't be able to pattern match on the input being a list regardless 
because you could have a list of lists and be wanting to delete one of those 
lists.

For example:
```elixir

List.delete([[:a, :b], [:c, :d]], [:a, :b])

#=> [[:c, :d]]
```

And I generally agree with others that the Enum module is sufficient for this, 
i.e `Enum.reject([:a, :b, :c, :d, :e], &(&1 in [:a, :b]))` reads pretty clear 
to me.

On Tue, Jun 07, 2022 at 11:31 AM, Randson < orand...@gmail.com > wrote:

> 
> Currently, the function `List.delete` only works for a single field. What
> I want to add is the possibility to delete multiple fields by passing a
> list of fields I want to remove.
> 
> 
> Can be like this one:
> 
> 
> ```elixir
> List.delete([:a, :b, :c, :d, :e], [:a, :b])
> #=> [:c, :d, :e]
> ```
> 
> 
> Or, it can be a new function to totally deal with that. like:
> 
> 
> ```elixir
> List.delete_many([:a, :b, :c, :d, :e], [:a, :b])
> #=> [:c, :d, :e]
> ```
> 
> 
> What do you guys think about that?
> 
> 
> Cheers,
> *Randson*
> 
> 
> 
> 
> --
> 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 (
> elixir-lang-core+unsubscr...@googlegroups.com ).
> To view this discussion on the web visit https:/ / groups. google. com/ d/
> msgid/ elixir-lang-core/ fdbd07d7-22af-4af8-b5cf-2823727e33ebn%40googlegroups.
> com (
> https://groups.google.com/d/msgid/elixir-lang-core/fdbd07d7-22af-4af8-b5cf-2823727e33ebn%40googlegroups.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/l44eia1n.acab4c4a-823b-4861-b8ae-5c671853b52a%40we.are.superhuman.com.

Reply via email to