What does this MixProject structure means?

Hi everyone,
I am totally new to elixir and when I create a new mix project. The return value of the functions in mix.exs seems weird to me. Can you please help to explain it ?
For example :

def project do 
[
  app: :test,
  version: "0.1.0", 
  elixir: "~> 1.9"
]
end

What kind of data structure this project function return ? Is that a list ? or a map ? The [ ] make me think that it is a list but why every item is a key:value pairs ?

This is a keyword list, you can read more about it in the getting started guide: https://elixir-lang.org/getting-started/keywords-and-maps.html#keyword-lists

Basically it’s a list of two-item tuples. So it could be written as

[{:app, :test}, {:version, "0.1.0"}, {:elixir, "~> 1.9"}]
3 Likes

Thank you for pointing that out @Nicd I seems overlooked the official document.