fukuoka.ex代表のpiacereです 今回もご覧いただいて、ありがとうございます Elixirで関数を書いていると、Enum.drop()のような、複数キーが指定可能な処理をサクっと書きたいシチュエーションがあります 単独キーの関数を、複数キー対応することで、このコツのようなものをシェアしたいと思います 関数サンプル:マップリストを単独キー指定で文字列置換 マップリストのマップにある値を、単独キー指定で文字列置換する関数を以下のように書いてみます defmodule MapList do @doc """ Replace map value ## Examples iex> MapList.replace( [ %{ "c1" => "v1", "c2" => "v2" }, %{ "c1" => "v3", "c2" => "v4" } ], "c1", "v", "Value"