Use keyword lists for ‘options’-style parameters that contains multiple key value pairs:
We can call the function above like so:
which is equivalent to:
The argument values are available as opts.pizza
and opts.soda
respectively.
Other Examples
Ecto’s query language uses this pattern:
You can probably guess by now, but the above code is actually:
Yes, the second parameter of the from
function is a keyword list.