I am now doing it like this in a route:
query = %{ type: params["type"] } query = if !!params["language"], do: Map.put(query, :language, params["language"]), else: query query = if !!params["id"], do: Map.put(query, :language, params["id"]), else: query I wonder, could we afford a function to decide whether to put the key?(I do mention this as a proposal if there is no best practice.) RIP, Joe. -- 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/11ef9a1a-1bbd-4ce3-93ff-3ad16466cb0e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.