Elixir
(note: you could skip a step here by just having a list of keys.)
Starting place: https://devdecks.io/2022-remove-multiple-key-value-pairs-from-map/
map = %{k1: :v1, k2: :v2, k3: :v3}
exampleMap = %{k1: :anyName, k2: :valueDoesNotMatter}
removeMap = Map.keys(exampleMap)
newMap1 = Map.drop(map, removeMap)
removeMap2 = Map.keys(newMap1)
newMap2 = Map.drop(map, removeMap2)
IO.inspect([newMap1, newMap2])
Look at your current IEx process's iex_history queue:
(also in this post ... traversing a twice nested Keyword list)
first iteration: uses Enum.at to get by index and work on my machine.
(Process.info self) |>Enum.at(5) |>elem(1) |> Map.new |> Map.fetch(:iex_history) |> elem(1)|>
IEx.History.each(&IO.inspect/1)
second iteration: uses Keyword.fetch to make the solution more compatable with other peoples computers.
(Process.info self) |>Enum.at(5) |>elem(1) |> Keyword.fetch(:iex_history) |> elem(1) |>
IEx.History.each(&IO.inspect/1)
final iteration, uses get_in and avoids how the previous solutions added complications to the data structure wrapping parts tuples along the process.
self |> Process.info |> get_in([:dictionary,:iex_history]) |> IEx.History.each(&IO.inspect/1)